On Thu, 5 May 2005 13:37:55 +0200, Alvaro G Vicario
<al******************@telecomputeronline.com> wrote:
BTW, in my experience mysql_pconnect() is the way to kill the database
server: I used to get the max connections limit error when I had two
visitors and 98 idle open connections. I'd suggest mysql_connect() instead.
It depends on your configuration (e.g. number of child processes from
webserver) and number of distinct credentials used to access the database. If
your config/usage pattern doesn't match up then persistent connections in
general can easily knacker the database as you point out.
I've always thought that PHP's persistent connection system should have a
timeout where it closes connections after a while, it could piggy-back onto
requests the same way as the sessions garbage collector. It seems the only way
to do this is through your database config (if the database offers an "idle
timeout" option), or through your webserver config (e.g. MaxRequests on Apache
child processes). Seems to me it would be neater to have PHP manage its own
connection pools a bit more intelligently instead of having to configure other
tools further down the chain (which may have impact on things _other_ than PHP
that are using them).
--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool