Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running apache 2.2 with PHP 5.2 in FastCGI mode with mod_fcgid. The platform is RedHat Enterprise Linux 5.5 x86_64. I have my minimum and maximum fastcgi slaves set to 35. How do I track how many php-cgi processes are busy at a certain point in time? I want to see if I'm running out of php-cgi processes and need to increase the number of processes running. I can use "ps" to see how many processes are running, but not how many are busy. How can I see if Apache is blocking on a free php-cgi process?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You can parse it from mod_status page:

busy_workers=`lynx -dump http://domain.com/server-status?auto | awk '/BusyWorkers/ { print $2 }'`
share|improve this answer
    
Thanks, but this would only work if I was using mod_php, where each apache process has a PHP interpreter. I'm using PHP as a FastCGI process pool with mod_fcgid. When using FastCGI, the number of Apache workers is a different pool from the number of PHP workers/processes. PHP processing doesn't happen within the Apache process with this method. This setup improves performance and reduces memory usage. –  edgester Aug 25 '11 at 17:03
1  
mod_status also supports FastCGI: svn.apache.org/viewvc?view=revision&revision=835406 –  quanta Aug 26 '11 at 7:02
    
Do I need to enable ExtendedStatus for that to work? –  edgester Aug 26 '11 at 18:14
    
No, you don't. ExtendedStatus On give you extra info: Total Accesses, Total kBytes, ... –  quanta Aug 27 '11 at 2:54
    
Sigh. I still don't see anything on the status page regarding FastCGI or fcgid. I guess I don't that patch isn't in my version of Apache. –  edgester Aug 27 '11 at 14:07
add comment

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.