2

I am trying to decide which AWS RDS instance type is to be used.

I have the stats of the number of database connections required by the application.

Is it possible to know which AWS RDS instance type supports how many database connections approximately?

I have the following list with me, but I'm not sure how accurate it is to date:

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  2540

Is there any official AWS document for the same?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Dev1ce
  • 5,390
  • 17
  • 90
  • 150
  • What kind of database do you intend to use in RDS? – Dunedan Oct 07 '19 at 07:58
  • This answer may help you: https://serverfault.com/questions/862387/aws-rds-connection-limits. – Hassan Murtaza Oct 07 '19 at 08:06
  • @HassanMurtaza yes I read that answer, was just wondering how reliable the info on it is, pretty old question and answers. :/ – Dev1ce Oct 07 '19 at 09:30
  • @Dunedan MySql and Postgres – Dev1ce Oct 07 '19 at 09:31
  • 1
    This is the AWS Aurora documentation that is current to answer your Connection limits by model. https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Managing.Performance.html – Wilson Hauck Oct 11 '19 at 00:01
  • This may be of use to you for NON Aurora documentation on TCP connection limits. https://forums.aws.amazon.com/thread.jspa?threadID=231806 – Wilson Hauck Oct 11 '19 at 00:17
  • @WilsonHauck Thanks, the first link was helpful, you got reference for standard RDS connection max connections as well? – Dev1ce Oct 11 '19 at 06:33
  • 1
    The second link has a FEW model's Connection Limits. Not generally published by AWS from what I can see. BUT here is how you request from AWS EC2 limit CHANGES for your installation. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html – Wilson Hauck Oct 11 '19 at 12:30
  • There are no practical references on how to calculate the max_connections value. The AWS documentation states that by default the max_connections are calculated using the DBInstanceClassMemory, although how to calculate that, is another enigma. The approach of querying the database, is also useless if you have limited access. Lastly, the AWS Aurora User Guide proves useless for any other type of instance. – nicosierra Jan 03 '20 at 11:27

1 Answers1

5

You can also verify the max_db_connection value

# mysql>show max_connections;

or

Click on the default Parameter Group and search for max_connections and you’ll see the formula. In my case, it’s {DBInstanceClassMemory/magic_number}.

But the numbers in the max_connections column look slightly awkward because they are actually calculated from a formula DBInstanceClassMemory/magic_number where magic_number differs according to the class of your instance.

You can check this link for updated documentation MySQL Managing Performance.

It's mean the higher the memory, the instance will capable to handle more connection. you check DB instance class size here.

The maximum number of connections allowed to an Amazon RDS MySQL DB instance is based on the amount of memory available for the DB instance class of the DB instance. A DB instance class with more memory available will result in a larger amount of connections available

Choose RDS class.

If you create a new parameter group to customize your own default for the connection limit, you'll see that the default connection limit is derived using a formula based on the DBInstanceClassMemory value. As shown in the preceding table, the formula produces connection limits that increase by 1000 as the memory doubles between progressively larger R3, R4, and R5 instances, and by 45 for different memory sizes of T2 instances. The much lower connectivity limits for T2 instances are because T2 instances are intended only for development and test scenarios, not for production workloads. The default connection limits are tuned for systems that use the default values for other major memory consumers, such as the buffer pool and query cache. If you change those other settings for your cluster, consider adjusting the connection limit to account for the increase or decrease in available memory on the DB instances.

Adiii
  • 54,482
  • 7
  • 145
  • 148
  • how do you calculate the DBInstanceClassMemory? I think it depends heavily on the instance type (and not only as a percentage of RAM). – nicosierra Jan 03 '20 at 11:34