0

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?

3
  • 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. Commented Oct 14, 2021 at 17:21
  • 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 Commented Oct 16, 2021 at 16:13
  • 1
    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. Commented Oct 16, 2021 at 17:39

1 Answer 1

0

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

2
  • 1
    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. Commented Oct 18, 2021 at 20:18
  • yep, I did that Commented Oct 18, 2021 at 21:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.