Bug #18551 Updated: multiple pconnect => too many established TCP connection

From: Date: Thu, 25 Jul 2002 09:56:00 +0000
Subject: Bug #18551 Updated: multiple pconnect => too many established TCP connection
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15150@lists.php.net to get a copy of this message
ID: 18551 Updated by: georg@php.net Reported By: tl@ccf.fr -Status: Open +Status: Closed Bug Type: MySQL related Operating System: windows 2000 PHP Version: 4.2.2 New Comment: Please download the current CVS version and use mysql_pconnect with the optional parameter client_flags: mysql_pconnect($user, $password, $host, MYSQL_CLIENT_INTERACTIVE); This forces mysql to close idling persistent connections. You have to set the variable interactive_timeout in your my.cnf (300 should be ok). Previous Comments: ------------------------------------------------------------------------ [2002-07-24 18:52:21] tl@ccf.fr PHP is running as apache module (apache version 2.0.39) Multiple call to mysql_Pconnect on same mysqldb host with eachtime same host,user and password parameters cause in somecase to return different php ressourceID. So, as persistent connection on php apache module will be available until thread die, (silently) more and more opened connection to mysql are made. After a certain time, it causes apache to stop to serve http request (without apache2 service die) with an "Cannot get free socket to listen on 0.0.0.0:80) because at this time, it seems there is too many TCP ESTABLISHED state connection between apache and mysql (near 80 on my system). Trying to play with multithreading apache configuration, can delay this problem (serveral hours), but not resolve it;Same for apache keepalive sets to on or off. The only way I found to avoid this trouble is just use non-persistent connection. In this case I can observe that there is always one uniq ressource id for the same host, user and password mysql_connect. PS: Mysql and apache on the same computer. Mysql, apache and php timeouts configurations are all sets by default. Mysql, apache and php are newer installion on a newer W2000 computer. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18551&edit=1

« previous php.bugs (#15150) next »