Question

Regarding MYSQL database connection limits, How long does 1 connection last?

I am trying to work out how much RAM I need for a MYSQL database based off the 75 simultaneous connections per 1GB ram rule.

If one connection was made to a MYSQL database how long would it be classed as connected?

Is it that as soon as the database has returned the response then it is no longer connected or is there a time limit, for example if the database was queried once then would it still be connected after after a certain amount of time which would contribute to the simultaneous connections limit.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

This would really depend on a few things on your side:

  • How much data you have in your database.
  • The complexity of your queries
  • The indexes that you’ve added

With those things in mind, the timing would depend on each individual application.

The best way to test this with your own data and your own website/app by running a load test:

https://www.digitalocean.com/community/tutorials/an-introduction-to-load-testing

That way you will be able to see how many concurrent connections your website is able to handle with your current server resources and then you will be able to make an informed decision based on the results.

Hope that this helps.

Best,

Bobby