Nginx – one php5-cgi process uses 100% cpu

debianfastcginginxPHPphp-fpm

I have a dedicated server runs debian 6, nginx 1.07, php 5.3 with php-fpm and percona mysql 5.1.

I just set up the server recently and only 1 site runs on it.

The problem I encounter is that even I have 10 php fastcgi processes set but 1 php5-cgi process consumes 100% cpu while the other 9 consume almost 0%. At this time, whole server is slow and so does the site.

Best Answer

You can try checking the exact script causing the CPU usage, by running:

ps faxuewwww

This way using the 'e' ps option, it will print out the environment variables for each process, also the php-cgi one. Most of the time there is plenty of useful info in env vars, to see which script is making the cpu usage.