MySQL Forums
Forum List  »  Performance

Re: max_connection
Posted by: Rick James
Date: November 13, 2011 07:12PM

I have studied a dozen calculations of RAM usage. The are all bogus. Most are terribly pessimistic -- they assume that every thread is in the throws of a big sort, etc.

There is no perfect value for max_connections. But here are some guidelines:
* Your clients should disconnect when they are through. Keep @@global.wait_timeout low (say, 60 seconds) to kick out such naughty connectors.
* Beware of persistent connections from clients like Apache, with a high MaxClients; they can unnecessarily glom onto too many connections.
* Watch the high-water metric, Max_used_connections. If it gets close to max_connections, either raise max_connections, or figure out why there have been so many connections at once.

From experience with many systems, I say that 1000 in likely to be much too high.

For the newbie... Simply set it to 100. When (if) you are denied connections, dig deeper.

While we are in the area, rarely does thread_cache_size need to be more than 10.

For some other important settings, see:
http://mysql.rjweb.org/doc.php/memory

Options: ReplyQuote


Subject
Views
Written By
Posted
5227
November 08, 2011 09:44PM
1086
November 09, 2011 08:58AM
1103
November 13, 2011 04:07AM
Re: max_connection
1171
November 13, 2011 07:12PM
925
November 15, 2011 07:35AM
1060
November 18, 2011 10:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.