one php5-cgi process uses 100% cpu
Solution 1
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.
Solution 2
A php-cgi stuck at 100% mean a stuck request (i.e.: an infinite loop), maybe you can check your error.log to find some info after that request will get killed when it reach the max_execution_time.
Jamesckemp
.Net Programmer, also interested on iOS, python, RoR.
Updated on September 18, 2022Comments
-
Jamesckemp over 1 year
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.
-
Jamesckemp over 12 yearsthanks giovanni, i haven't found error message in my error log files. Should I do some more configurations to php.ini or nginx.conf to grab the log?