The question was asked previously, "how do I calculate MySQL max_connections" and this was the answer:

max_connections = (Available RAM - Global Buffers) / Thread Buffers

Since I don't have enough reputation to add a comment to the existing question I had to ask a brand new question.

I can get the buffer values by executing : SHOW VARIABLES LIKE '%buffer%'; but what is the available RAM part of this equation exactly?

Is this value in bytes, kilobytes, megabytes? Something else? Also, do I use the available RAM shown in the resource monitor while my site is being used, or do I need to use the total amount of RAM installed on the machine?

up vote 0 down vote accepted

I'd say 'Available RAM' means max memory mysql can claim. And 'Global buffers' would mean buffers like innodb_buffer_pool, key_buffer_size, query_cache_size, etc.

  • So in what format do I plug the available ram into the formula? Bytes, kilobytes, megabytes? Something else? – Vincent Oct 9 '14 at 16:16
  • As long as you are consistent with the unit, you should arrive at same result. I'd go for MB. – Manny Calavera Oct 9 '14 at 18:40

At this time you can use mysqlcalculator.com to assist with determining your RAM footprint in about 2 minutes if you have your SHOW GLOBAL VARIABLES; list available.

The default of 151 is a reasonable starting point. After running for some time, you may, but probably won't, see any problems. If you do have problems, any of several things could need tweaking -- including indexes on tables. max_connections rarely needs tweaking.

Bottom line: Don't fret over that one settings.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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