[horde] Too many simultaneous SQL connections

Claude Tompers claude.tompers at restena.lu
Tue Jul 3 11:57:31 UTC 2012


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.

kind regards,
Claude

-- 
Claude Tompers
Ingénieur réseau et système
Fondation RESTENA - Réseau Téléinformatique de l'Education Nationale et de la Recherche
6, rue Richard Coudenhove-Kalergi
L-1359 Luxembourg

Tel: +352 424409 1
Fax: +352 422473

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-countless-mysql-conns.patch
Type: text/x-patch
Size: 1953 bytes
Desc: not available
URL: <http://lists.horde.org/archives/horde/attachments/20120703/41b8c902/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.horde.org/archives/horde/attachments/20120703/41b8c902/attachment-0001.bin>


More information about the horde mailing list