15

‘fuser’ Using 100% CPU in Ubuntu 11.10

Posted in Linux, PHP

After upgrading to 11.10 recently, I occasionally noticed fuser firing up and using between 70% and astoundingly 9999% CPU. Googling the issue led me to this post with the solution.

As user grazer explains:

We have the same problem. This is the content of /etc/cron.d/php5 on 11.10:

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

And this is the content on 11.04:

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

Spot the difference?

The 11.10 version runs fuser for each PHP session file, thus using all the CPU when there are hundreds of sessions.

After commenting out the 11.10 line and replacing with the 11.04 equivalent, this problem was solved for me aswell. Thanks, grazer!

You can also check out the bug report to keep up to date on this issue. Hopefully a fix will be released quickly.