2008-05-11 21:28:33 |
Jakob Unterwurzacher |
description |
Binary package hint: php5-cgi
This Bug is already reported here: http://bugs.php.net/bug.php?id=40286
and here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=431799
I see it in Ubuntu Dapper
$ php-cgi --version
PHP 5.1.2 (cgi-fcgi) (built: Jul 17 2007 17:21:59)
Quoting from: http://bugs.php.net/bug.php?id=40286
----------------
Context:
When running PHP in FastCGI mode with a fastCGI apache module (such a
mod_fcgid), all is running fine when PHP_FCGI_CHILDREN unset : only 1
process spawned. When using PHP_FCGI_CHILDREN=n, the PHP parent process
forks n childs, and the parent acts as a manager between the child
processes, wait()ing to respawn them if they are killed or exit. The
problem happens when the FastCGI process manager handled by the apache
module has to kill the parent PHP process (it only knows the parent's
PID) for any reason such as idle timeout, max lifetime, etc.
Problem:
While the PHP parent process is properly killed by the FastCGI process
manager, the children aren't killed, but instead stay alive, waiting for
a new request which will never come (because the socket shared with the
parent is removed at the same time parent is killed).
---------------- |
This Bug is already reported here: http://bugs.php.net/bug.php?id=40286
and here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=431799 (inactive)
I see it in Ubuntu Hardy now:
PHP 5.2.4-2ubuntu5 with Suhosin-Patch 0.9.6.2 (cgi-fcgi)
Quoting from: http://bugs.php.net/bug.php?id=40286 :
When running PHP in FastCGI mode with a fastCGI apache module (such a
mod_fcgid), all is running fine when PHP_FCGI_CHILDREN unset : only 1
process spawned. When using PHP_FCGI_CHILDREN=n, the PHP parent process
forks n childs, and the parent acts as a manager between the child
processes, wait()ing to respawn them if they are killed or exit. The
problem happens when the FastCGI process manager handled by the apache
module has to kill the parent PHP process (it only knows the parent's
PID) for any reason such as idle timeout, max lifetime, etc.
Problem:
While the PHP parent process is properly killed by the FastCGI process
manager, the children aren't killed, but instead stay alive, waiting for
a new request which will never come.
This sooner or later uses up all availible RAM and lead to a DOS.
Workaround: See comments. |
|