The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/tmp

Discussion in 'General Discussion' started by sigep739, Jan 30, 2005.

  1. sigep739

    sigep739 Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    6
    I am having some strange files build up in my tmp directory. I do not think they are related to hackers (although I did have an issue with them a while back). Any idea? What are the .wrk files?

    Code:
    _30909_107_8.wrk*               sess_78b103d99491e623e453a74b684b7bca
    _30910_99_0.wrk*                sess_7aaab1320733de7eb9e55206d24d9c49
    _30982_102_3.wrk*               sess_7d1f518bbe07ed1f59c4acbfeab05f96
    _30988_106_7.wrk*               sess_894c767801e95d1d2203c11763238399
    _31062_100_1.wrk*               sess_8c0e8110305beb60add6fcb20f61140d
    _31065_99_0.wrk*                sess_8c578d484ecd10ae41ea5675740c6adc
    _31085_102_3.wrk*               sess_900cb2dd85bb4e4bf4766841112524fd
    _3229_123_24.wrk*               sess_9c92979075b151ac0e4776369f2d4070
    _32506_195_96.wrk*              sess_a08e74f86e7dfb65603173498ac87014
    _3579_210_111.wrk*              sess_a1a8de6fffc11030687bf03781a21f55
    _3587_150_51.wrk*               sess_bd884aeaef077aaf7ba449a8710964cf
    _3588_150_51.wrk*               sess_d11ce60f6ed6d50fda3996d657274ae5
    _3668_160_61.wrk*               sess_d7fb668244edaa8a81ba61d0a3f3e174
    _3992_123_24.wrk*               sess_dc5e75cc9b7a7a2fe28a9303dafd367f
    _4001_106_7.wrk*                sess_de817763d82d539dff4d1e327a99404c
    _400_1246_1147.wrk*             sess_e099bd2e1f682bb46db40f8f6144131a
    _4004_120_21.wrk*               sess_e10e191af89c74b1e4a84bf34fc64b2e
    _4817_32319_32220.wrk*          sess_e17dfe4e75698391c644ee340210dc3f
    _4818_13300_13201.wrk*          sess_e6dd15700f71f7d04285ed59dc465dc6
    _4818_25435_25336.wrk*          sess_e9fa33fc2043e08a484ee928be495aa8
    _4818_8300_8201.wrk*            sess_f1f110cd221006d81f0c61513ac80539
    _4819_18349_18250.wrk*          sess_f283ce84e67c051d3ef3d4174bd7356d
    _4819_1879_1780.wrk*            sess_fec7f7bfb808a6f4808af6b712642873
     
  2. tAzMaNiAc

    tAzMaNiAc Well-Known Member

    Joined:
    Feb 16, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sachse, TX
    Could be from one of the scripts one of your customers uses that dumps files in /tmp..

    Why don;t you open one of them and see what is in it..

    Brenden
     
  3. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA

    .wrk files are created automatically by the apache module called mod_gzip. It's a wonderful module that compresses live pages on the fly and the browsers on the other end decode after the file is downloaded. Typical text and html file size can be dramatic and will increase the speed especially 56k users will notice while on your sites. What I have found if these files and really large is that sometimes if a customer writes a script that errors into a loop that the page never "finishes" being created and mod_gzip can't delete the files becuase the process dies. This can be a cause of /tmp filling up past quota and then apache won't even run. If all these files and scattered in dates and times ranging in a week or 2 and they are all fairly small ..like less than 1MB in size you should be ok. If you find that there are say 10 in there that are like 10MB or larger ...all behind each other in timestamp that it possibly means you have a client that is troubshooting a script and can't figure out why he sees nothing but a blank page ..while in fact mod_gzip never finnishes the endless error loop page. Either way just clean out your /tmp .wrk files or you can comment out the mod_gzip referrences in apache httpd.conf if you would prefer not to run it. I use it on all my boxes and when I turn it off I get 50 emails from people the next day asking why the server got slower ..so it's great in general. Hope this helps you :)

    You can use this page below BTW to check and see the results of using it on your pages.
    mod_gzip tester

    Hey do a # ls -lh /tmp for me and paste back here so I can see.
     
    #3 rpmws, Jan 30, 2005
    Last edited: Jan 30, 2005
  4. marius

    marius Well-Known Member
    PartnerNOC

    Joined:
    Jun 10, 2002
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bucharest
    i had the same problem.
    it turned out that one of our client's files were corupted and when accessing his site one file created an infinite loop.. so the wrk files were 250mb :).
     
  5. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    How to tell if Gzip is enabled?

    I just thought I'd tag this on the end here since its relevant.

    I didn't have mod_gzip installed until I read this (I'm still quite new to this) and from reading this thread I decided it was a good idea.

    So I went to WHM > Software > Update Apache and out of the options given, I chose to tick the previously unticked "Gzip Module (experimental) (Version 1.3.26.1a)".

    After WHM did its thing correctly, it appeared that all had gone well.

    I then decided to check if gzip was then working, and went to http://leknor.com/code/gziped.php to check and, for the URL I checked, it stated that the content was not gzipped!

    The output from the above URL for the domain showed the following in the headers:

    Code:
    Apache/1.3.33 (Unix) mod_gzip/1.3.26.1a mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a
    However there is no "Content-Encoding", which I have noticed present and having the value "gzip" for gzip enabled hosts.

    The above header snippet indicates to me (with my limited knowledge) that gzip is installed.

    Anyone have any idea why I'm not gettig gzipped content from my server or what I have to do to make it work?
     
  6. shopcentar

    shopcentar Well-Known Member
    PartnerNOC

    Joined:
    Jul 10, 2004
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    8
    .wkr script control

    Hello,

    here is my script that control evry 1 min. what is size for tmp directory and is if size bigger than we make delete all sessions and wrk files.

    script is tested and working great.


    lines2=`du -shb /tmp` #check size for specific dir
    dirpattern=/tmp # pattern for remove and get onlly number

    v0=$lines2
    v1=${v0/%$dirpattern/} #
    v1=${v1/% /}

    # check size if is bigger than 334MB than make delete
    if (( v1 >= 342413824 ))
    then
    echo "tmp overloading..."
    echo "/tmp directory..." | mail -s "/tmp directory... delete *.wrk " your@mail

    rm -f /tmp/*.wrk
    rm -f /tmp/sess_*
    fi


    my tmp dir is set to 512MB so you set your size like 222413824 bytes if you have tmp dir set on 250 MB

    by, SC
    PS. and in crontab add evry one min. checking
     
    #6 shopcentar, Feb 12, 2005
    Last edited: Feb 12, 2005
    marius likes this.
  7. marius

    marius Well-Known Member
    PartnerNOC

    Joined:
    Jun 10, 2002
    Messages:
    157
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bucharest
    great thanks
     
  8. Secret Agent

    Secret Agent Guest


    Could you please explain how to use this script? Am I supposed to copy/paste into a file under any name and just run it? Also, what would the line in crontab be? I already have one there to delete /tmp every one hour so I assume that has to be removed.
     
  9. hostit1

    hostit1 Well-Known Member

    Joined:
    Jul 24, 2003
    Messages:
    88
    Likes Received:
    0
    Trophy Points:
    0
    I run the below at midnight. I have not had any problems with it.

    mv -f /tmp/.webmin /tmp/webmin
    rm -f /tmp/*.wrk
    rm -f /tmp/sess_*
    rm -f /tmp/*-session*
    rm -f /tmp/*TMP*
    rm -fR /tmp/php*
    rm -fR /tmp/*.gz
    rm -fR /tmp/*.pl
    rm -fR /tmp/dos*
    rm -fR /tmp/*tgz
    rm -fR /tmp/*htm*
    rm -fR /tmp/.*
    rm -fR /tmp/*_*
    rm -fR /tmp/*-*
    mv -f /tmp/webmin /tmp/.webmin

    NOTE: If you are running PGSQL, you may want to illiminate the rm -fR /tmp/.*
     
  10. eglwolf

    eglwolf Well-Known Member

    Joined:
    Jan 1, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Could someone explain how I can take those lines of code and set it up to work in the server, I am having the same tmp directory problem using mod_gunzip.
     
  11. shopcentar

    shopcentar Well-Known Member
    PartnerNOC

    Joined:
    Jul 10, 2004
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    8
    check your httpd.conf file via SSH and if you dont have this lines:
    #APACHE httpd.conf
    pico /usr/local/apache/conf/httpd.conf

    mod_gzip_minimum_file_size 1024
    mod_gzip_maximum_file_size 20971520
    mod_gzip_maximum_inmem_size 2097152

    add them and restart apache
    #check httpd.conf syntax
    /etc/rc.d/init.d/httpd configtest

    #and if you dont have error make restart APACHE
    /etc/rc.d/init.d/httpd restart

    by, Sasa
     
    #11 shopcentar, May 27, 2005
    Last edited: May 27, 2005
  12. eglwolf

    eglwolf Well-Known Member

    Joined:
    Jan 1, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for the help!
     
Loading...

Share This Page