Skip to content

Aurora MySQL max_connections limit for db.t4g.medium

0

What is the hard limit for max_connections parameter on a db.t4g.medium Aurora MySQL instance?

The AWS documentation lists the default as 90 and mentions a maximum of 16,000, but does not specify an instance-specific limit.

Does this mean I can set it to e.g. 500 as long as CPU and memory can handle the load, or is there a lower hard limit or recommended maximum for t4g.medium?

Thank you in advance.

asked a month ago118 views

1 Answer
1

For Aurora MySQL on a db.t4g.medium instance, the maximum allowed value for the max_connections parameter is 16,000 across all instance types. This is the hard upper limit enforced by the database engine itself, not a per-instance-class restriction.

However, the practical consideration is memory availability. The default value of 90 for db.t4g.medium is calculated using a formula based on the instance's available memory (DBInstanceClassMemory). While you can technically set max_connections to 500 or higher within the 16,000 limit, you need to carefully consider whether the instance has sufficient memory to support that many connections.

Each database connection consumes memory, and setting max_connections too high can lead to out-of-memory conditions, especially on smaller instance types like the T4g family. The defaults are tuned for systems using default values for other major memory consumers like the buffer pool. If you've modified those settings, you should adjust the connection limit accordingly to account for changes in available memory.

Best practice is to set max_connections slightly higher than the maximum number of connections you actually expect to open on the instance. If you need to support many more connections than the default allows, consider using Amazon RDS Proxy to manage connection pooling efficiently, or evaluate whether a larger instance class would be more appropriate for your workload.
Sources
Quotas and constraints for Amazon RDS - Amazon Relational Database Service
Managing performance and scaling for Amazon Aurora MySQL - Amazon Aurora

answered a month ago

AWS
SUPPORT ENGINEER

reviewed a month ago

AWS
SUPPORT ENGINEER

revised a month ago

AWS
SUPPORT ENGINEER

revised a month ago

AWS
SUPPORT ENGINEER

revised a month 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.