Portal Home > Knowledgebase > Articles Database > nginx+php_cgi has high load average


nginx+php_cgi has high load average




Posted by heropage, 06-03-2013, 10:51 AM
I am using http://www.cyberciti.biz/faq/rhel-fe...re-nginx-php5/ The connection is not high, only 2000, netstat -an |grep 80 |wc -l 2000. but the load is super high, it's over 100. When I restart php_cgi, the load is low, but it goes high slowly. I notice the cpu usage is low, only 3%. And the memory usage is low as well, only 2G out 12 G. This is strange. Normally, with nginx+php_cgi, the memory usage is about 90%. The cpu usage is over 50%. I have server using nginx+php_cgi, it can handle 7000+ connection without an issue, the load is about 10. The only different is the version of nginx. The one on new server is latest version(nginx/1.4.1), the one I use for other project is nginx/1.0.15. The other different is the version of centos. here is the php_cgi config when the server has high load, there is error in the error log the server config Intel(R) Xeon(R) CPU E5620 @ 2.40GHz memory 12G.

Posted by BestServerSupport, 06-03-2013, 11:54 AM
Can you please paste entire Nginx error log message for this certain error message? it seems that your provided error message is not complete.

Posted by heropage, 06-03-2013, 11:57 AM

Posted by BestServerSupport, 06-03-2013, 12:55 PM
One possible solution is to increase the value of server_childs. Edit /etc/init.d/php_cgi and increase the value of server_childs. Please do not forget to restart php cgi (/etc/init.d/php_cgi restart).

Posted by heropage, 06-03-2013, 02:22 PM
I'll try to increase to 90 and see how it goes

Posted by heropage, 06-03-2013, 04:56 PM
same thing. Right now, I have to create a conjob to restart php_cgi every hour

Posted by Zilovic, 06-04-2013, 06:29 AM
Hi, The loadavg is exactly the average number of processes ready for execution the last (1, 5 and 15 minutes). A first suspicion would be that (php cgi) processes are not terminated correctly. A second common possibility is processes in 'D' state (uninterruptible sleep). When you are experiencing high load, it would be useful to see the output of 'ps aux', and either some vmstat+iostat statistics OR the columns of top (10s delay is better than the default of 3s). The requested information will make the determination of the root cause easier.

Posted by heropage, 06-06-2013, 02:10 PM
it turns out it's php mysql issue! Thanks for your help!



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Language: