I have a MySQL database server, db.t3.micro, parameter group is 'default.mysql8.0', max_connections is '{DBInstanceClassMemory/12582880}'
I figured out that it cannot handle more than ~63 connections
According to AWS RDS documentation https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.MaxConnections
Connection limit for Mysql is calculated using '{DBInstanceClassMemory/12582880}' formula, where DBInstanceClassMemory tier instance memory in bytes.
So for db.t3.micro 1Gb it is 1073741824/12582880 = 85
‘SHOW VARIABLES LIKE "max_connections";’ returns 63
Tier | Memory, GiB | Memory, Bytes | Calculated connection limit | Real connection limit |
---|---|---|---|---|
db.t3.micro | 1 | 1073741824 | 85 | 63 |
db.t3.small | 2 | 2147483648 | 170 | 146 |
db.t3.2xlarge | 32 | 32x1073741824 | 2720 | 2634 |
Why real connections limit is less than the formula result?
So DBInstanceClassMemory is actually TotalMemory- (Memory consumed by OS + other processes)
Amazon documentation clearly says
but that is not true, and real DBInstanceClassMemory will be less than 16GiB