Re: SUEXEC (but why one instance)
Michael <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
David Birnbaum <davidb@...> writes:
>
> Michael,
>
> PHP uses its own process manager, so it won't work in any sort of normal
> FastCGI sense, as best as I can figure. Here's what worked for me:
>
> http://www.fastcgi.com/docs/faq.html#PHP
>
> David.
Something in here just isn't quite right I think.
I looked at php-4.3.9/sapi/cgi/README.FastCGI. It seems to suggest that PHP
can be configured as a daemon for FastCGI, at which it accepts connections and
spawns itself, or you can 'Configure your web server to run the PHP binary
itself'. It also shows a 'dynamic' configuration much like mine, and says I can
also use a static configuration as well.
So it seems as though it should work.
So to take a look at the PHP code (I parsed out things that don't matter and
replaced with comments. [sapi/cgi/cgi_main.c]
if( getenv( "PHP_FCGI_CHILDREN" )) {
/* get environment variable, set variable 'children' if valid */
if( children ) {
/* Create a process group for ourself & children */
setsid();
pgroup = getpgrp();
/* Set up handler to kill children upon exit */
/* Rest of scheduling code */
}
So as far as I can tell, If I choose not to set that variable (Which I haven't
such as the use of a wrapper in David's example, or passing it through the
environment), then it will run a single instance that accepts FastCGI requests.
Wouldn't a single instance that accepts fastCGI requests mean that the FastCGI
scheduler/process manager should be able to create multiple PHP interpreters,
each accepting FastCGI requests but not forking on their own (which is what is
happening, but it's not creating multiple interpreters when load increases).
Which doesn't seem to make sense. This gets me thinking it's a configuration
issues which is preventing it from seeing the load and growing the number of
interpreters.
Any ideas?
-M
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/