You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2009/11/03 14:41:31 UTC

DO NOT REPLY [Bug 48110] New: Doc of mod_fcgid: "PHP child process management" appears incorrect

https://issues.apache.org/bugzilla/show_bug.cgi?id=48110

           Summary: Doc of mod_fcgid: "PHP child process management"
                    appears incorrect
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: strube@physik3.gwdg.de


In the documentation page of mod_fcgid, there is a paragraph concerning "PHP
child process management":
*BEGIN CITATION*
PHP child process management (PHP_FCGI_CHILDREN) should always be disabled with
mod_fcgid, which will only route requests to application processes it has
spawned.  Any child processes created by PHP will be unused and may not be
terminated properly.  By default, and with the environment variable setting
PHP_FCGI_CHILDREN=0, PHP child process management is disabled.
*END CITATION*
This appears incorrect according to my long experience with mod_fastcgi and
recent tests with mod_fcgid. With PHP_FCGI_CHILDREN > 0, the PHP process
spawned by the module does no actual work but only spawns (and, if necessary,
respawns) children that do the processing of the data stream passed to them by
the parent PHP. It is easily seen (e.g., using "top") that practically only the
child PHP processes consume CPU time -- that they "will be unused" is
completely wrong. mod_fcgid does not need any knowledge about the child
processes. Of course, one should then configure mod_fcgid so that (for one
class) there is exactly one parent PHP process, which should run permanently,
and leave the distribution of work to this process rather than to mod_fcgid.
We have such a configuration running on our webserver (with mod_fastcgi, but
also tested with mod_fcgid) for a long time. Especially, using the APC
extension of PHP, this allows the common usage of the shared-memory code cache
of APC by the spawned PHP processes.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48110] Doc of mod_fcgid: "PHP child process management" appears incorrect

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48110

--- Comment #3 from HWS <st...@physik3.gwdg.de> 2009-11-04 05:26:37 UTC ---
More info re "This could mean that a PHP parent with several children would not
be faster than a single PHP process.(I have not really measured this, also
don't know whether mod_fastcgi and mod_fcgid act differently in this respect.)"

I just compared mod_fastcgi and mod_fcgid using PHP_FCGI_CHILDREN = 1 or 2 in
both cases and benchmarking with "ab -n 50 -c 2 http://...." on a
multiprocessor SPARC server (Solaris 10). Indeed, with mod_fastcgi, the time
was halved for PHP_FCGI_CHILDREN=2, whereas this was not the case with
mod_fcgid! Thus, mod_fastcgi is superior in this respect. (On a
single-processor machine, this will probably be irrelevant.) Configuration was:
    FcgidIPCDir /some/dir
    FcgidProcessTableFile /some/file
    FcgidIdleTimeout 0
    FcgidMaxProcesses 1
    FcgidMaxProcessesPerClass 1
    FcgidMinProcessesPerClass 1
    FcgidInitialEnv PHPRC /some/path
    FcgidInitialEnv PHP_FCGI_CHILDREN 2 # or 1 or 0
    FcgidInitialEnv TZ MET
    FcgidFixPathinfo 1

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48110] Doc of mod_fcgid: "PHP child process management" appears incorrect

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48110

--- Comment #2 from HWS <st...@physik3.gwdg.de> 2009-11-03 07:49:28 UTC ---
Well, I think that the PHP child processes are simply irrelevant to mod_fcgid;
the  parent PHP is the only one seen and treated like a single PHP process. I
do not understand "if the PHP process created by mod_fcgid is idle or has an
idle child process because it has passed a current request to a child,
mod_fcgid still will not send another request to it." How can the parent PHP
process possibly be considered idle by mod_fcgid as long as one of its children
is still processing a request?
But you really make an important point: "will not route to a process if a
request previously routed to it is still in progress." This could mean that a
PHP parent with several children would not be faster than a single PHP process.
(I have not really measured this, also don't know whether mod_fastcgi and
mod_fcgid act differently in this respect.) Then your replacement would make
sense.
However, in my scenario with APC extension, the child management by a PHP
parent is even then advantageous, since crashed children are replaced without
losing the content of the APC shared-memory cache (which is created during
parent startup and is shared with the children).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48110] Doc of mod_fcgid: "PHP child process management" appears incorrect

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48110

--- Comment #1 from Jeff Trawick <tr...@apache.org> 2009-11-03 06:58:53 UTC ---
Hi there,

I'm glad to see that someone is reading the new docs, and I must confess that
the PHP-related information is particularly deserving of scrutiny due to the
lack of PHP documentation in this area as well as the wide distribution of
conflicting information about behavior with mod_fcgid.

The heart of the matter is that mod_fcgid will not route a request to a process
it has not created, and will not route to a process if a request previously
routed to it is still in progress.  Thus, if the PHP process created by
mod_fcgid is idle or has an idle child process because it has passed a current
request to a child, mod_fcgid still will not send another request to it.

I think this incomplete+incorrect information

"... which will only route requests to application processes it has spawned.
Any child processes created by PHP will be unused ..."

can be replaced with

"... which will only route requests to application processes it has spawned,
and is not aware that PHP may have passed active requests to another PHP
process.  Any child processes created by PHP will not be effectively utilized
..."

Does this make sense?

Do you have empirical evidence to the contrary?

Thanks!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48110] Doc of mod_fcgid: "PHP child process management" appears incorrect

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48110

Jeff Trawick <tr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Jeff Trawick <tr...@apache.org> 2010-01-20 17:22:33 UTC ---
corrected inaccuracies and added note about APC cache in

http://svn.apache.org/viewvc?view=revision&revision=901480

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48110] Doc of mod_fcgid: "PHP child process management" appears incorrect

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48110

Jeff Trawick <tr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Documentation               |mod_fcgid

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org