|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-10-07 17:33 UTC] mtremblay at sitebrand dot 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
I have the same problem running version 4.2.3 on a FreeBSD 4.6.2. And I check the problem running this script: <? $con = mysql_connect('localhost','user','pass'); mysql_select_db('midb',$con); $q = "Select * from categorias order by nombre limit 5"; $res = mysql_query($q,$con); while($r = mysql_fetch_array($res,$con)) { print "<p>".$r['nombre']."</p>"; } print "<hr>"; $q = "Select * from vinculos order by nombre limit 5"; $res = mysql_query($q,$con); while($r = mysql_fetch_array($res,$con)) { print "<p>".$r['nombre']."</p>"; } print "<hr>"; mysql_close($con); ?> and checking the mysql client console with: mysql> show status like "%onnection%"; and Max_used_connections incrementes like if the mysql_close didn't exists.