Bug #10841: Only last(?) of multiple mysql_pconnect() connections get reused
| From: | Thomas dot Lamy at netwake dot de | Date: | Sun, 13 May 2001 22:50:59 +0000 |
| Subject: | Bug #10841: Only last(?) of multiple mysql_pconnect() connections get reused | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-55102@lists.php.net to get a copy of this message | ||
From: Thomas.Lamy@netwake.de
Operating system: Linux 2.2.19
PHP version: 4.0.4
PHP Bug Type: MySQL related
Bug description: Only last(?) of multiple mysql_pconnect() connections get reused
After doing multiple (say 3) mysql_pconnect() from within
one page, as suspected the number of mysql threads
increases, but only the last connection made is being reused
by subsequent calls to mysql_pconnect from other pages/requests.
This is a bit unconfirmed, since I don't have the time and
resources right now, but tests on a production site (which
has crashed very often the last time) showed that the
following code cut down the number of mysql threads at least
tenfold:
if (!@mysql_select_db ("test")) {
mysql_pconnect("db","user","pass") or die ("No
DB:".mysql_error());
mysql_select_db ("test") or die ("database does not exist:
".mysql_error());
}
--
Edit Bug report at: http://bugs.php.net/?id=10841&edit=1