MySQL Max Connections – Calculate Using Available RAM

max-connectionsMySQL

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?

Best Answer

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.