ID: 37422
Updated by: dmitry@php.net
Reported By: phpbugs at thequod dot de
-Status: Open
+Status: Closed
Bug Type: CGI related
Operating System: Ubuntu Linux
PHP Version: 5.1.5CVS
Assigned To: dmitry
New Comment:
The README.FastCGI is fixed in CVS HEAD and PHP_5_2.
PHP crashes are already fixed.
The "indle timeout" error is not a bug. It may occur on high load, then
requests concurrency is larger then number of running PHP processes.
Previous Comments:
------------------------------------------------------------------------
[2006-05-29 23:00:48] phpbugs at thequod dot de
Here is a backtrace of a process running without
PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS being set (so
there's only one instance):
#0 0xb7802d2c in recv () from /lib/tls/libc.so.6
#1 0x0837cf99 in fcgi_finish_request (req=0xbff29d94)
at /home/XXX/cvs/php/php51dev/sapi/cgi/fastcgi.c:620
#2 0x0837d760 in fcgi_accept_request (req=0xbff29d94)
at /home/XXX/cvs/php/php51dev/sapi/cgi/fastcgi.c:633
#3 0x0837ee7c in main (argc=1, argv=0xbff2c464)
at /home/XXX/cvs/php/php51dev/sapi/cgi/cgi_main.c:1333
It seems to hang there around for a while and all requests
that arrive get an idle timeout error.
This is PHP 5.1.5-dev (cgi-fcgi) (built: May 29 2006
01:33:02) (DEBUG).
It appears to be just a overload on the server/number of
simulatneous requests, as I can reproduce it with
ab2 -n PHP_FCGI_CHILDREN+1 -c PHP_FCGI_CHILDREN+1
www.site/
and a script that does "sleep( timeout + 1 );".
But I've never seen those errors before 5.1.3-dev and
therefor cannot really believe that this is the only
cause.
------------------------------------------------------------------------
[2006-05-17 18:56:34] phpbugs at thequod dot de
Sidenote: The cause for the "read failed" error was due to
the exhausted memory_limit, see
http://bugs.php.net/?id=37481
Still, there's the "idle timeout" error (when using
PHP_FCGI_CHILDREN=4 and MAX_REQUEST=100).
It does not seem related to the "read failed"/memory_limit
(e.g. memory leak because of it), at least I think so
after triggering "memory exhausted" errors.
------------------------------------------------------------------------
[2006-05-17 17:00:39] phpbugs at thequod dot de
I see at least three bugs here:
- documentation is wrong (default values)
- reproducable crash
- occassional errors like:
[Wed May 17 18:34:35 2006] [error] [client 88.247.169.170]
(104)Connection reset by peer: FastCGI: comm with
server "/var/www/XXX/php5-fcgi-starter" aborted: read
failed
[Wed May 17 18:34:35 2006] [error] [client 88.247.169.170]
FastCGI: incomplete headers (0 bytes) received from
server "/var/www/XXX/php5-fcgi-starter"
and
[Wed May 17 18:34:20 2006] [error] [client 72.30.111.157]
FastCGI: comm with server "/var/www/XXX/php5-fcgi-starter"
aborted: idle timeout (60 sec)
[Wed May 17 18:34:20 2006] [error] [client 72.30.111.157]
FastCGI: incomplete headers (0 bytes) received from
server "/var/www/XXX/php5-fcgi-starter"
after the server has been running some time..
I cannot reproduce it, though and don't know how I should
debug it.
What's strange about all those timeout errors:
max_execution_time is set to 30.
Since I've tested the 5.1.3 RCs, php-fastcgi is not usable
anymore in production for me! I think I'll have to go back
to 5.1.2 for now.
5.2-dev does not seem to have this problem (around them
time the snapshot has been posted here), but I don't think
it's a good idea to use it in production.
------------------------------------------------------------------------
[2006-05-17 14:04:10] mike@php.net
No Bug? Bogus. Thanks.
------------------------------------------------------------------------
[2006-05-16 06:26:48] phpbugs at thequod dot de
The described problem, where PHP_FCGI_CHILDREN is set, seems rather to
be a PHP application problem:
I was using fsockopen on URLs, without having set a transfer timeout
through stream_set_timeout(). Therefor the FCGI process timed out on
requests to URLs, which did not respond in a given time. I've setup the
fastcgi-Server with a timeout of 60 seconds.
It seems to cause no more problems with current CVS (PHP 5.2.0-dev
(cgi-fcgi) (built: May 15 2006 22:28:11)) and probably also not with
5.1.4, which I'll re-try now.
Having "crashes" with unset PHP_FCGI_CHILDREN is bad IMHO,
nevertheless. Can it be fixed?
Can you see in my backtraces what the missing stream_set_timeout() in
my script "triggered"? I find the message "buf=0xfffffffc <Address
0xfffffffc out of bounds>,
count=4294967292" quite "unusal".
btw: please update sapi/cgi/README.FastCGI accordingly, because it
still says that by default 8 childs get used!
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/37422--
Edit this bug report at http://bugs.php.net/?id=37422&edit=1