Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to figure out exactly what's going on that kicks CPU usage in random httpd workers so high but I'm having a little hard of a time figuring out what PHP page is being requested so that I can try to figure out why it's chewing up CPU. If PHP were done as regular (as opposed to Fast) CGI I could look at the process list, but we're using mod_php.

Is there a way to get PHP 5.3 to report performance statistics for currently running scripts? This may also be relevant if we decide to eventually go the php-fpm route.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If you enable mod_status and turn on ExtendedStatus, it will display the request being handled by each worker.

share|improve this answer
    
This is exactly what I was needing, ty. –  Joel Davis Mar 28 at 18:25

First of all I am not sure if you can do that with normal php but you can use php-fpm to show you a status page in this link you can see how to do it: https://rtcamp.com/tutorials/php/fpm-status-page/

Second you can enable slowlog in php-fpm with this you can see which script are running so slowly. here's an exaple to how to do it: https://rtcamp.com/tutorials/php/fpm-slow-log/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.