Score:0

AWS RDS MySQL connection limits

in flag

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?

Tim avatar
gp flag
Tim
Have you tried updating the value? Might be that it's running out of memory on that small server and can't handle and more and AWS has updated the value.
in flag
I've added a db.t3.2xlarge case, servers have no load, and current memory usage doesn't make any sense, DBInstanceClassMemory - is total amount of the memory
Tim avatar
gp flag
Tim
I don't think this isn't the type of thing many people would have done. It might be worth getting AWS support for a month, if no-one here can help. I'd have a good search for documentation and blog articles first though.
Score:0
in flag

So DBInstanceClassMemory is actually TotalMemory- (Memory consumed by OS + other processes)

Amazon documentation clearly says

db.m5.xlarge instance class. DBInstanceClassMemory is 16 GiB, or 17,179,869,184 bytes

but that is not true, and real DBInstanceClassMemory will be less than 16GiB

Tim avatar
gp flag
Tim
Are you suggesting that connection limits are based on memory available after OS and other processes are running? That would seem reasonable, as connections do take memory, but if that's the case the documentation should probably be clarified. If you provide feedback on the AWS documentation using their links I find AWS staff often respond and update pages based on reasonable suggestions.
in flag
yep, I did that
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.