Issue:
Users are getting below error when they browse website which is hosted on AWS.
Could not connect to the database: SQLSTATE [HY000] [1040] too many connections.
Root Cause:
AWS RDS database has Database connection limitations.
Solution:
- Increase the database connection limit.
- Login to AWS management console.
- Go to RDS > Parameter groups > Select your database parameter group name
- Select and edit max_connections parameter.
- Change the value according to your requirement.
- You can also upgrade your instance to next gen instance type based on your requirement.
Default Values for RDS instances:
t2.micro | 66 |
t2.small | 150 |
m3.medium | 296 |
t2.medium | 312 |
M3.large | 609 |
t2.large | 648 |
M4.large | 648 |
M3.xlarge | 1237 |
R3.large | 1258 |
M4.xlarge | 1320 |
M2.xlarge | 1412 |
M3.2xlarge | 2492 |
R3.xlarge | 254 |