CPU stuck at 99% for a few hours: figuring out logs

This is a cron job that cleans up old session files from /var/lib/php5/ . If it hangs on 99% you should perhaps check out the destination folder ( /var/lib/php5/) for an excessive amount of files or perhaps even filesystem corruption.

The process is started from crontab. See the crontab listings (described here). You kan kill the process and remove it from crontab, but it's more likely that you have an underlying problem such as an excessive amount of files that needs to be fixed.


Found the answer here: http://www.flynsarmy.com/2011/11/fuser-using-100-cpu-in-ubuntu-11-10/

in /etc/cron.d/php5 on Ubuntu 11.10:

Replace
09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete

With
09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete

Tags:

Linux

Ubuntu

Logs