|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-03 14:03 UTC] mfischer@php.net
[2002-06-12 15:23 UTC] hermannj at slu dot edu
[2002-06-12 15:39 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 08:00:02 2026 UTC |
Apache child processes hang when: 1. A PHP script (let's call it connect.php) sends a mysql_connect request to a MySQL server. 2. The MySQL server is powered down - completely shut off. Example of connect.php: <?php mysql_connect("db","user","pass") || or die("OMG!"); ?> ps ax | grep httpd | wc shows 14 httpd processes After calling http://www.domain.com/connect.php with a browser ps ax | grep httpd | wc shows 15 httpd processes Hitting stop on the browser has no affect. 15 processes remain. After calling /apache/bin/ap -n 200 -c 200 http://www.domain.com/connect.php This will call the script 200 times concurrently. ps ax | grep httpd | wc shows 152 httpd processes (MaxClients reached) Now going to http://www.domain.com/ produces nothing but a timeout. Since there is no mysql_connect timeout, the Apache processe hang indefinately. Result: server hosed! This is much too fragile. Gracefuly restarting Apache has no affect since it is waiting for the child processes to complete. You must stop Apache and start Apache to resume operations. Environment: Tru64 Unix PHP 4.1.2 MySQL builtin libraries