> > I am by no means an expert, by I always close the connections explicitly. > > My understanding is that the connection gets closed eventually, but by MySQL > > itself after a time out period. > > OK, that makes sense. I didn't want to do that just yet, because > things have been running fairly well since I ditched persistent > connections.
There are a couple of factors here. -- when the Apache process actually terminates, because of Apache's process settings -- when the PHP script "shutsdown" which should typically mysql_close() the connections to MySQL -- when MySQL will kill a connection thread because of thread-reuse/caching settings > The curious thing is that MySQL doesn't seem to be cleaning them up. I > checked last night, and there were some threads that had been in sleep > for more than 7,000 (seconds?). That does seem like a long time. On the mysql server, do show variables like '%thread%'; and show status like '%thread%'; See if anything looks out of wack as far as configuration and server stats go. Are these threads being reused (check the thread ID). Is this a high-load server? You may want to try to restart Apache - if this then kills those threads from sleeping, you've isolated it to something in Apache/PHP. These aren't persistent connections right? There was a bug sometime ago in glibc (if I remember correctly) that prevented connections from closing correctly, but this likely isn't the problem so double check the PHP code/config. H _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php
