2

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.

Alex Chen
  • 283
  • 2
  • 3
  • 10

2 Answers2

5

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.

gryzli
  • 191
  • 3
1

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.

Giovanni Toraldo
  • 2,587
  • 19
  • 27
  • thanks 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? – Alex Chen Oct 16 '11 at 17:53