On 10/22/2007 10:20:37 AM +0200, Daniel Schlenzig <[EMAIL PROTECTED]> wrote:
> I was wondering, in the configuration above you mentioned:
> 
> (httpd)
> MaxRequestsPerProcess 500
> 
> (php wrapper script)
> PHP_FCGI_MAX_REQUESTS=2000
> export PHP_FCGI_MAX_REQUESTS
> 
> are these lines still accurate in your current configuration? If so,
> you should change these values to be the same.

Not necessarily, because PHP support for multiple children is very 
inconsistent. I found out that using PHP without children, and let 
mod_fcgid do the automatic spawn control is far better in the resource 
management, than letting PHP doing (or rather not doing) it. PHP cannot 
automatically spawn additional processes when needed (already got the 
"skip spawn request" message?).
Some other problems : PHP_FCGI_MAX_REQUESTS does apply to each PHP 
subprocess (child) and not the whole PHP process tree, while mod_fcgid 
treat the tree as only one process (because there is only one, not 
multiplexed pipe to communicate with the php subprocesses, through the 
PHP main process). Then, MaxRequestsPerProcess is meaningless is the 
tree mode, because PHP restarts children who have died after 
PHP_FCGI_MAX_REQUESTS requests. (And since the parent PHP process does 
only process management and NOT PHP processing, killing it each N 
requests is useless and does not free memory).

We have 2 process managers here : the mod_fcgid one (which has adaptive 
spawn control, not very accurate, but exists), and the PHP-in-tree-mode 
one, enabled with PHP_FCGI_CHILDREN (which does nothing except maintaing 
a tree of N PHP children, and forwarding PHP requests). The latter is 
only useful because opcode cache systems share the cache which the whole 
PHP tree.

After testing the two methods, I found out that using mod_fcgid without 
any opcode cache and disabling the PHP tree mode, is far more memory 
efficient, and does a much better load handling. Indeed, when the opcode 
cache is used in shared mode, some bugs still exist and are very hard to 
find (mostly triggered by race conditions), and the whole tree 
eventually blows up with the parent process exiting with signal 11 and 
all the children still running, lost and eating memory without being usable.

Here is my conclusion of several years running PHP in fastcgi mode, and 
having tested all the possible methods.

Gabriel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mod-fcgid-users mailing list
Mod-fcgid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users

Reply via email to