Php – Troubleshooting PHP High CPU on Production Server

central-processing-unitdebuggingPHP

We're trying to find a bug that will cause multiple PHP processes to be run at the same time and thus eating up the CPU resources for around 5 minutes. During these 5 minutes, our server will totally inaccessible.

We can't seem to replicate the problem and not to mention seeing the same problem on our staging server. My question is will installing xdebug on our production server help us finding the root of the problem? Will xdebug affect our production servers performance?

Regards
Joe Thong

Best Answer

in apache, set ExtendedStatus On if u have mod_status compiled - http://httpd.apache.org/docs/2.2/mod/mod_status.html#extendedstatus

with this, u able to monitor what are the URL that causing the infinite loop or spawn multiple background processes

or even simpler, log the time taken for apache to serve a single page - http://httpd.apache.org/docs/2.2/mod/mod_log_config.html %D or %T and diagnose the log file

Related Topic