Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the best way to increase the max connections?

I plan on hitting my DB with a lot of connections (hundreds/thousands per second, they will open and close pretty quick from a multi threaded app). I am running MySQL on Ubuntu.

share|improve this question
up vote 2 down vote accepted

First answer is DON'T. In almost all scenarios a high amount of max connections is bad, as you will be wasting a large amount of resources for very little gain. Instead what you should be doing is to create a connection pool and reuse your connections. It will give you way better performance (both in ram and latency), especially if you are doing thousands of transactions per second.

To change the max connections value you use max connections:

Your OS and RAM is likely the limiting factor. Unless you have a huge amount of ram you are unlikely to be able to serve more than a few thousand connections at the same time.

Also, have a look at

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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