DB Connections Upper Limit


I've successfully increased the max_connections value for one of my replicas (db.m4.large) from the default provided by AWS using a parameter group. I am trying to figure out the maximum number of connections the DB can support.

I've ran some tests where I cause X number of connections to occur and then look at the change in freeable memory and get a rough calculation of freeable memory used per connection. I've ran many tests with different numbers of connections and load on the DB and it seems the freeable memory decrease is independent of the load on the DB and related to the number of connections.

I can use these data points to calculate a value for amount of freeable memory decrease per DB connection (~0.4-0.9 MB / connection), but I'm wondering how accurate or useful of a calculation this is in determining how many connections I can support. Some questions:

What else besides number of connections can cause freeable memory to decrease?

What is the limitation to how many DB connections you can have? Is it limited by freeable memory, CPU Utilization, something else?

Edited by: taylor10 on Feb 19, 2020 12:02 PM

asked 4 years ago201 views
1 Answer


The below information is with respect to RDS MySQL:

-- The default value of 'max_connections' in RDS MySQL is specific to a particular DB instance type. This is because, this parameter depends on the RAM available for a DB instance.
Max_connections (default value) = ‘DBInstanceClassMemory (in bytes)/12582880’.

-- However, the allowed values for this parameter is 1-100000

-- Hence, you can consider modifying the parameter 'max_connections' in the parameter group associated with your DB instance. But, it is recommended to increase this value if the DB instance has sufficient resources (CPU , Memory) to serve increased connections. This is because, each connection requires resources, if the connections are increased to a value higher than what could be handled by the DB instance type, the connections may not get required resources resulting in performance issues.

Best regards,


answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions