#23891 [Opn->Bgs]: PHP doesn't close MySQL 4.0 persistent Connections > "Too Many Connections"
| From: | iliaa@php.net | Date: | Fri, 30 May 2003 13:24:35 +0000 |
| Subject: | #23891 [Opn->Bgs]: PHP doesn't close MySQL 4.0 persistent Connections > "Too Many Connections" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-40708@lists.php.net to get a copy of this message | ||
ID: 23891
Updated by: iliaa@php.net
Reported By: jan dot lange at artada dot de
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: Redhat 7.1
PHP Version: 4.3.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
If you use mysql_select_db() or slightly different connection string
you can have more open connections then you have process. That is the
most likely case in your situation.
Previous Comments:
------------------------------------------------------------------------
[2003-05-30 04:36:03] jan dot lange at artada dot de
Hi!
I have upgrade to MySQL 4.0.12 (later to 4.0.13) with PHP 4.3.1 (and
now also 4.3.2).
Persistent Connections in php.ini is "On"
It is a Webserver with many Sites on it. So after 2 to 4 hours every
php page says "Too Many Connections"
So I look at Processlist, and there are more than 50 processes online!
I look with "show processlist" and it were exactly 100 rows in it, so
it were 100 connections!
When I restart apache, alle connections were closed and the php pages
works fine for the next 2-4 hours.
I have made tests. And I'm thinking, this is a PHP Bug!
Because, I do ONE mysql request over PHP (with pconnect), so I have a
persistent MySQL link!
I do exatly the same request again (refresh in browser) now I have 2
MySQL links, and so on.
The links were closed when MySQL have done a connection time-out,
because there were always in state "sleep"
When I look at phpinfo() page, at the MySQL section I see on the activ
Webserver 1 or 2 activ persistent links. But on MySQL it were 88
connections or more.
So I think, php close the MySQL connections and think they were closed,
but they don't be in real.
On the latest MySQL 3.23 release, the Webserver have worked always fine
with persistent connections.
Greetings
Jan
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23891&edit=1