mySQL max connections
| From: | Shane Wright | Date: | Tue, 30 Jul 2002 11:25:04 +0000 |
| Subject: | mySQL max connections | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20885@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I have a database thats taking a bit of a hammering - enough so that the
number of connections spirals up and out of control.
max_connections was originally at the default of 100 - but rising above 50 or
so meant actual throughput dropped so the db never got a chance to keep up
(meaning manually restarting the db). I've lowered max_connections to 40
which at least keeps the db alive.
But, the number of connections keeps rising to and bouncing off this limit -
and for the users that hit it a 'Too many connections' error is given.
Now, I've optimised everything as much as is humanely possible - and the only
way out I can see so far is to have some kind of connection queue to keep
people waiting for the 1/2 second or so until the load spike drops off (I'd
rather have a few slow pages than errors any day).
Is there any way of doing this - I've looked at back_log (the listen()
backlog), but that doesnt really apply.
Short of writing a 'hide-warning-wait-a-bit-and-try-again' chunk in PHP
(sucky!) I'm stuck!
Using persistent connections doesn't stunningly help either - it only gives a
small performance increase
Any help appreciated, thanks.
- --
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9RneQ5DXg6dCMBrQRAsQTAKCxNem6+NTNY/I1Wtwstil7axtykACgpUiG
c1e7on4Fu9jgYWhYNLxJAH4=
=H/Op
-----END PGP SIGNATURE-----