Menu

#17 PHP Interface: too many connections

open-accepted
None
5
2003-06-24
2003-06-11
Anonymous
No

With ht://Check 1.2.1 I encounter a 'TOO MANY
CONNECTIONS' error from MySQL frequently. It seems the
number of connections to the mysqld daemon rises with
page serves as this dump shows.

mysql> SHOW FULL PROCESSLIST;
+----+---------+-----------+-------------+---------+------+-------+-----------------------+
| Id | User | Host | db | Command |
Time | State | Info |
+----+---------+-----------+-------------+---------+------+-------+-----------------------+
| 2 | htcheck | localhost | htcheck_idp | Sleep |
482 | | NULL |
| 4 | htcheck | localhost | htcheck_idp | Sleep |
439 | | NULL |
| 6 | htcheck | localhost | htcheck_idp | Sleep |
408 | | NULL |
| 9 | htcheck | localhost | htcheck_idp | Sleep |
360 | | NULL |
| 11 | htcheck | localhost | htcheck_idp | Sleep |
326 | | NULL |
| 13 | htcheck | localhost | htcheck_idp | Sleep |
264 | | NULL |
| 14 | htcheck | localhost | htcheck_idp | Sleep |
266 | | NULL |
| 16 | htcheck | localhost | htcheck_idp | Sleep |
232 | | NULL |
| 18 | root | localhost | NULL | Query | 0
| NULL | SHOW FULL PROCESSLIST |
+----+---------+-----------+-------------+---------+------+-------+-----------------------+
9 rows in set (0.00 sec)

I found that mysqldb.inc.php opens a connection in the
Connect method. However I failed to find a
corresponding close although this may be due to my
MySQL/PHP ignorance.

Discussion

  • Gabriele Bartolini

    • assigned_to: nobody --> angusgb
    • status: open --> open-accepted
     
  • Gabriele Bartolini

    Logged In: YES
    user_id=28915

    In some circumstances I got it too, but not only with
    ht://Check's PHP interface. However I have not been able to
    understand the reason.

    In PHP however, when you open a persistent connection you
    don't have to close it: PHP will do it for you. In this case
    it seems like there are some problems with this, but I guess
    it is due to the PHP/MySQL layer.

     

Log in to post a comment.

MongoDB Logo MongoDB