Bug #13589 Updated: Persistent connections stay open and accumulate
| From: | georg@php.net | Date: | Wed, 10 Jul 2002 13:27:27 +0000 |
| Subject: | Bug #13589 Updated: Persistent connections stay open and accumulate | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13729@lists.php.net to get a copy of this message | ||
ID: 13589
Updated by: georg@php.net
Reported By: mtremblay@sitebrand.com
-Status: Assigned
+Status: Closed
Bug Type: MySQL related
Operating System: RedHat 7.1
PHP Version: 4.0.6
Assigned To: zak
New Comment:
To fix this problem, you should set your mysql-server
variable timeout_interactive to the number of seconds
(default is 28800).
For pconnect use the optional 4th parameter client_flags:
mysql_pconnect($host, $user, $pass,
MYSQL_CLIENT_INTERACTIVE);
This allows interactive_timeout seconds (instead of
wait_timeout seconds) of inactivity before closing the
connection.
This new optional parameter is available in the latest
CVS-tree.
Previous Comments:
------------------------------------------------------------------------
[2001-12-31 19:16:22] zak@php.net
doh.
------------------------------------------------------------------------
[2001-12-31 19:08:34] zak@php.net
Assigning to myself
------------------------------------------------------------------------
[2001-11-20 12:55:15] derick@php.net
However, this is something else. This need to be investigated first.
------------------------------------------------------------------------
[2001-11-20 12:31:00] sander@php.net
This is what Derick said about this (in #14149):
This is not a bug, the MySQL extension will open a new connection if
the _current apache child_ has no open connection to MySQL.
With this in mind, it's very normal to see that apache has multiple
connections open to MySQL.
------------------------------------------------------------------------
[2001-10-07 17:33:26] mtremblay@sitebrand.com
While trying to use persistent connections for performance on an ad
server, connections to the MySQL server stay open and accumulate over
time until it hits the max_connections setting is hit. Once this
happens, MySQL refuses to allow connections.
After looking at the MySQL process list, it seams that connections are
not always recycled. In theory, idle established connections' Commands
should be "Sleep" but curiously, it looks like connections not being
recycled have "Query" command and a state of "NULL".
Presently using MySQL 3.23.36.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=13589&edit=1