- Newest
- Most votes
- Most comments
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
Relevant content
asked 2 years ago
asked 4 years ago
