Clean space on your server tmp folder
This may happen to more than one person, it happen to me in almost all server we currently manage and believe me, it is a nasty job to keep up, clients websites gone, email not being sent out from the server, databases not updating and more are the symptoms of this problem.
The first thing you should look at is the available space on each of your mount drives, log in to your SSH as root and run the following command:
# df –h
This will display all mounted drives including the “Usage %” that is the one you have to look at.
In case you have something like the following:
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 996M 996M 0 100% /tmp
Right there you know you are in trouble.
The solution is simple, edit your crontab:
# crontab –e
Add the line below to it:
30 * * * * fuser -ck /tmp && rm -Rf /tmp/*
Save/Quit crontab
What that line really means is that every 30 minutes (change time as you need) the server will kill all process inserting information into your /tmp folder and them it will remove all data from it. Killing the processes before removing data is very important, the server could be writing data to the /tmp folder and even when you remove all info from it will show as 100% full yet until this data is written and the entire process ends.
Keep in mind that if you are running PHP on your server all session by default are saved on the /tmp folder, so they will be deleted from the server every 30 minutes… No good… I recommend to edit your php.ini and change the variable named session.save_path to something else (e.g. session.save_path = “/home/tmp”).
Hope this helps!!!
Categories
Archives
- July 2017 (1)
- May 2015 (1)
- November 2013 (2)
- August 2013 (1)
- September 2012 (3)
- June 2012 (1)
- May 2012 (4)
Tags Cloud
Android APC APC Cache bash Blackberry CentOS clamscan co cpanel databases HTML 5 install memcache iPhone linux load balanced servers memcache Memcached memcahed sessions MySQL PHP php sessions Server Cache shell ssh sticky notes available text formats sticky notes commands Sticky Notes format viruses webOS website antivirus website infections