Results 1 to 11 of 11
  1. #1

    Lots of big files in the /tmp dir

    The Diskspace used on my vps has increased rapidly over the last 2 days, on inspection i found that the /tmp directory holds 11GB - here is a shell snippet:

    512M /tmp/54671995
    512M /tmp/36796665
    512M /tmp/18486694
    512M /tmp/15642322
    512M /tmp/20817339
    512M /tmp/47171382
    512M /tmp/55431131
    512M /tmp/56451131
    512M /tmp/63270600
    512M /tmp/29074177
    512M /tmp/17907982
    0 /tmp/sess_97e275d1cee558dd523b6edca6a65463
    0 /tmp/sess_adecb170fcad7e73192c32ff105eeb35
    0 /tmp/sess_888290d1a2eec30c4ac49fcdb32ed331
    0 /tmp/sess_2f617f716c0dc429ce0c8aeea946720c
    0 /tmp/sess_b96be771b792460d31427d4a3163da3c
    0 /tmp/sess_5102d9ebe217aaebc59137b5face3fc6
    512M /tmp/40733131
    512M /tmp/50582835
    96M /tmp/43187368
    0 /tmp/sess_786a1dbcbdbd535db1cbba8c12107a90
    0 /tmp/sess_8f5dab7348ca907b0e1cf83900908aad
    0 /tmp/sess_6fcd9a4b23e0017857c95f3ad1e4c4dc
    512M /tmp/26017704
    512M /tmp/37335199
    512M /tmp/47184934

    As you can see there are a lot of 512MB files, What are they? I don't want to delete them incase they are important or break the vps.

    Any Ideas?

  2. #2
    Join Date
    Mar 2006
    Albuquerque, New Mexico
    They look they might be files that are created by PHP scripts that are running (I'm actually not sure, but, least the sess_* ones). It's unusual for something to create that many files in /tmp. You could try moving them out of /tmp, rebooting, and seeing if it broke anything. If it broke something, move them back, otherwise, remove them.
    Nick Devito
    Atarack Communications, Inc - Xen-based VPS Services

  3. #3



    Thanks I cleared the tmp directory using ssh and the space used went down to 16k, just the session files however I checked again a few hours later and the size of the directory had increased to 3.5G with the same time of files, any ideas on how to prevent these files from being made?

    My host offers "/tmp & /var/tmp hardening We harden /tmp and /var/tmp so no malicious scripts can be executed from the commonly used directory." but you have to pay for it, can I do it myself and will it help solve the problem?

    Merry Christmas

  4. #4
    cron job that clears any files that aren't sessions?

  5. #5
    Join Date
    Oct 2002
    State of Disbelief
    Have you looked to see what type of file they are?
    cd /tmp
    file 54671995

    If it complains it's a directory, cd xxxx; ls -lap
    then file xxxx (whatever files it shows)

  6. #6
    mod_gzip created me the same issues with the /tmp folder.
    I cleaned tmp folder and disabled mod_gzip and had no problems after that.

  7. #7


    Thanks guys, I executed the file xxx command and got:

    [email protected] [/tmp]# file 15872571
    15872571: MS-DOS executable (EXE), OS/2 or MS Windows

    Very strange as I am running a Linux system. How did you disable mod_gzip (n00b question)


  8. #8



    Just checked the apache conf, mod_gzip is not installed on my system so that cannot be the problem i dont think.

    Whats really frustrating is, its created 4-5G every few hours. I also just realised I am still using php4, I dont think that is causing the problem but I will update it after Christmas.

    Any further Ideas?

  9. #9
    Join Date
    May 2003
    did you install any php caching software lately?

  10. #10
    Join Date
    Dec 2005
    You can harden /tmp directory via entering the values "loop,noexec,nosuid,rw" for /tmp partition in /etc/fstab. Then run #mount -a

  11. #11
    Solved the problem, it was down to some insecure scripts on my VPS. I have now recoded the site and moved to a Dedi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts