I'm running a dedicated MySQL server on an m1.large EC2 instance, which has 7.5 GB of RAM.

What might be a good number to set my max_connections value to?

link|improve this question

75% accept rate
feedback

2 Answers

This blog describes a simple method to calculate MySQL connections. Adding link here just to make this page useful. May you have already found an answer.

http://mysqlhacker.com/kabir/performance/calculating-maximum-connections-for-mysql-server.html

link|improve this answer
found the myisam_sort_buffer_size which I could definitely use if it can help. However I have successfully used 6000 connections on 32GB Ram in RDS, but it was one of those omgwtf! moments – Vangel Sep 15 '11 at 14:48
feedback

The answer depends on the expected workload: the expected number of concurrent connections and the expected time of a connection. The default value is set to 100. For a good and dedicated machine, you can increase it to some value like: 200, 500, or even more! You can set it to some value and watch your database connections. When you feel there is a need, you can increase it more. Of course, the default value might be small and should be increased.

The max_connections is not the only parameter to look at. There are other things that need to be done to achieve a better performance (like query optimization). Increasing the max_connections might not be always the best thing to do.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.