[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    mySQL max connections
From:       Shane Wright <me () shanewright ! co ! uk>
Date:       2002-07-30 12:48:47
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I have a mySQL 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 all the tables and queries 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.  If it makes any odds, the SQL only talks to 3 
tables, all are properly indexed and there's enough RAM to keep it all from 
swapping.

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)

iD8DBQE9Rosv5DXg6dCMBrQRAkMXAKCvGx8mYNEJoUPobtI093amT6RHAACcD3za
xMUz0AP1fcMxJoZZdO0BixY=
=zBoX
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread115889@lists.mysql.com>
To unsubscribe, e-mail <mysql-unsubscribe-mysql=progressive-comp.com@lists.mysql.com>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic