Re: problems with mysql connections not closing - update
| From: | Sek-Mun Wong | Date: | Mon, 01 Sep 2003 10:44:18 +0000 |
| Subject: | Re: problems with mysql connections not closing - update | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-21297@lists.php.net to get a copy of this message | ||
Ok, here's what I found so far.
1) wait_timeout doesn't work under windows
http://www.mysql.com/doc/en/News-4.0.15.html,
4.0.15 (dev) mysql is supposed
to fix this. In http://bugs.php.net/bug.php?id=13589 georg@php.net
advises
connecting like this:
mysql_pconnect($host, $user, $pass, MYSQL_CLIENT_INTERACTIVE);
(this uses the interactive_timeout setting in mysql)
I've tried this, but interactive_timeout still doesn't kill idle
connections.
2) http://jeremy.zawodny.com/blog/archives/000173.html
halfway down the page, John Lim says:
> Yes, yes, yes. And get rid of pconnect while your at it. It is somewhat
> slower when the number of connections is at a
> slower rate, but helps keep up availablity when the server is under
stress.
> Its a tradeoff.
> At any rate, creating connections to MySQL is very fast. Faster still if
> there are cached threads. When you get rid of pconnect you can see
> how many connections are attached simultaneiously at any one time. If
> you have more than one apache/PHP server connected to the MySQL
> server, the effects can be geometric. Once you get a general feeling
> for how many are usually connected at one time, set the thread cache
> to that number.
I might mail off to John to find out the full story on pconnect. AFAIK, I'm
considering it broken for now and going back to mysql_connect.