Re: Processes dying prematurely

Gasior <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Chris Lightfoot wrote:
> On Fri, Aug 25, 2006 at 08:54:42AM -0400, Ben Chabot wrote:
>   
>> I may have simply set this up incorrectly.  Should I be calling something
>> else?  Is there a php-pm application somewhere that calls these workers? 
>> Or is php with --enable-fastcgi supposed to spawn workers on it's own?
>>     
>
> PHP has two modes in its FastCGI implementation. One has a
> manager process which manages a set of child processes,
> all accepting and processing connections; those child
> processes then parse and run the actual PHP code. The
> other mode runs the interpreter in a single process. My
> experience is that the former mode is much more reliable
> than the latter; if you want mod_fastcgi or another
> process manager to manage the PHP processes, then set
> PHP_FCGI_CHILDREN to 1.
>
> The default *used* to be PHP_FCGI_CHILDREN=8 (and this is
> still what the documentation says) but at some point it
> was actually changed to 0, which enables the
> single-process mode (the second one described above).
>
> If you're starting PHP through some other mechanism, e.g.
> as an external server, then you may as well set
> PHP_FCGI_CHILDREN to some reasonable value and leave it to
> manage itself. That will save you some memory because of
> copy-on-write (though not much probably).
>
>   
Chris, my men, you are genius.
>From what i've tested it looks just like you said.

When i've set up PHP_FCGI_CHILDREN (even to 1), php started to manage
it's children on its own.
Now i see one fcgi-pm that executes php4-cgi, that executes
PHP_FCGI_CHILDREN * php-cgi procesess.

First php-cgi (it should be called php-pm ? ) stays there permanent,
while other exits after PHP_FCGI_MAX_REQUESTS and are restarted even if
you set PHP_FCGI_MAX_REQUESTS to some low value (no more "the script
failed to remain running for 30 seconds" ).

It looks like i can finally try to put this on production server and see
how it really works under fire :)

Chris, thanks again for this post.

Best regards
Gasior
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.