From:             oliver at realtsp dot com
Operating system: FreeBSD 6.2
PHP version:      5.2.5
PHP Bug Type:     CGI related
Bug description:  fastcgi socket dies on high concurrency

Description:
------------
Version information below.

When I load the server with siege, once the fastcgi-php parent process
reaches a load of ~200 concurrent requests the process appears to crash and
refuses to accept further connections, even after the load is removed
again. Only way to recover is to restart lighttpd and thereby the
fastcgi-php server (and its children).

Clearly a load of 200+ is probably overloaded not sustainable. However a
non-recoverable crash means that even when a temporary load drops away
(produced by some aggressive robot on our production setup for example) the
server remains unusable and returns 500 responses.

php version as below, but patched with this:

http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.202.2.7.2.15&r2=1.202.2.7.2.16&pathrev=PHP_5_2&diff_format=u

because of this bug:

http://bugs.php.net/bug.php?id=43295

That patch removes the errors on

/root/php-5.2.5/main/SAPI.c(445)

but the "overload crash remains".


[EMAIL PROTECTED] /usr/ports/lang/php5]# lighttpd -v
lighttpd-1.4.18 (ssl) - a light and fast webserver
Build-Date: Dec  5 2007 18:23:49

fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                 (
                                   "socket" =>
"/var/run/lighttpd/php-fastcgi.socket",
                                   "bin-path" =>
"/usr/local/bin/php-cgi",
                                   "max-procs" => 1,
                                   "bin-environment" => (
                                     "PHP_FCGI_CHILDREN" => "16",
                                     "PHP_FCGI_MAX_REQUESTS" => "500" ),
                                   "broken-scriptfilename" => "enable"
                                 )
                               )
                            )

[EMAIL PROTECTED] /usr/ports/lang/php5]# php-cgi -v
PHP 5.2.5 (cgi-fcgi) (built: Dec 16 2007 20:47:09) (DEBUG)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies


[EMAIL PROTECTED] /usr/ports/lang/php5]# php-cgi -m
[PHP Modules]
cgi-fcgi
date
libxml
Reflection
standard

[Zend Modules]

NOTE: no opcode cache or third party extensions

php.ini parsed is "none" (ie all defaults)


FreeBSD muriwai.realtsp.com 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12
08:43:30 UTC 2007     [EMAIL PROTECTED]:/usr/obj/usr/src/sys/SMP
 amd64



Reproduce code:
---------------
a trivial script will do:

<?php

sleep(1);
phpinfo();


with .siegerc

#
# Default number of simulated  concurrent users
# ex: concurrent = 25
#
concurrent = 250



Expected result:
----------------
php fastcgi parent process (and children) remaining stable. maybe an
"overloaded" or even temporary 500 type response would be acceptable. but
crashing and then being completely unreponsive is a bit of an issue.



Actual result:
--------------
lighttpd.error.log reports this

2007-12-16 21:19:22: (mod_fastcgi.c.1731) connect failed: Connection
refused on unix:/var/run/lighttpd/php-fastcgi.socket-87058-0
2007-12-16 21:19:22: (mod_fastcgi.c.2885) backend died; we'll disable it
for 5 seconds and send the request to another backend instead: reconnects:
0 load: 210
2007-12-16 21:19:22: (mod_fastcgi.c.3496) all handlers for  /index.php on
.php are down.

i haven't managed a backtrace yet, because this is not that easy with a
fastcgi process, but i am working on it.

NOTE: despite what lighty says above..it does not restart the php parent
process. I am not sure why, but this is a separate issue i believe.

-- 
Edit bug report at http://bugs.php.net/?id=43610&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43610&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43610&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43610&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43610&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43610&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43610&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43610&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43610&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43610&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43610&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43610&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43610&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43610&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43610&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43610&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43610&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43610&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43610&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43610&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43610&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43610&r=mysqlcfg

Reply via email to