[horde] Too many simultaneous SQL connections

Jan Schneider jan at horde.org
Thu Jul 5 10:51:19 UTC 2012


Zitat von Claude Tompers <claude.tompers at restena.lu>:

> Hi,
>
> Since we put the new Horde H4 Framework to productions, we saw every now
> and then error logs passing by like :
>
> [02-Jul-2012 12:50:44 UTC] PHP Fatal error:  Uncaught exception
> 'Horde_Db_Exception' with message 'Connect failed: (1226) User 'xxx' has
> exceeded the 'ma
> x_user_connections' resource (current value: 50)' in
> /usr/share/php5/PEAR/Horde/Db/Adapter/Mysqli.php:139
>
> After some debugging, we found out that a simple login triggers as much
> as 10 simultaneous SQL connections.
> We added some lines of code to reuse already established connections as
> much as possible and as a result we saw quite an impressive drop of
> connections on our MySQL server.
>
> I attached the patch for anyone who is interested. It is only for the
> MYSQLI driver but I think it could be ported to other drivers quite easily.

The correct solution would be to build the signature in  
Horde_Core_Factory_Db based on the Horde_Db_Adapter class parameters.
-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the horde mailing list