Choosing a database instance class in AWS with the maximum simultaneous connexions

It’s not always simple to know which kind of instance type we need in AWS for a database. So here is a point of view to help you in your choice : with the maximum simultaneous connexions possible.

(This tips can also be used to know which engine you w…


This content originally appeared on DEV Community and was authored by Maxime Guilbert

It's not always simple to know which kind of instance type we need in AWS for a database. So here is a point of view to help you in your choice : with the maximum simultaneous connexions possible.

(This tips can also be used to know which engine you want to use depending if you need a really high number)

Before going further

To be able to do the calculations, we need to know :

  • where we can found the list of memory size for each kind of instance
  • and how to convert a GiB in bytes

Memory size of each kind of instance

For that point, please check the AWS documentation : https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#Concepts.DBInstanceClass.Summary

How to convert a GiB in bytes

1 GiB = 1 073 741 824 bytes

MariaDB & MySQL

Following the AWS Documentation (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.MaxConnections), the calcultation of the max connections is :

DB Instance Class Memory / 12 582 880

Where DB Instance Class Memory is the memory size in bytes of an instance type.

It's maximum value is 100 000 for MySQL and MariaDB, but if the value is greater than 16 000 AWS RDS set it to 16 000.

So for a db.m5.xlarge instance :

16 GiB / 12 582 880
16 * 1 073 741 824 / 12 582 880
17 179 869 184 / 12 582 880
1 365 simultaneous connexions

Oracle

Following the AWS Documentation (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.MaxConnections), we can setup the maximum of sessions between 100 - 65 535 manually.

But here it's the number of processes which depends of the instance class. Here is the calculation:

LEAST((DB Instance Class Memory / 9 868 951), 20 000)

So for a db.m5.xlarge instance :

LEAST((16 GiB / 9 868 951), 20 000)
LEAST((16 * 1 073 741 824 / 9 868 951), 20 000)
LEAST((17 179 869 184 / 9 868 951), 20 000)
LEAST(1 740, 20 000)
1 740 processes

PostgreSQL

Following the AWS Documentation (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.MaxConnections), the calculation is :

LEAST((DB Instance Class Memory / 9 531 392), 5 000)

So for a db.m5.xlarge instance :

LEAST((16 GiB / 9 531 392), 5 000)
LEAST((16 * 1 073 741 824 / 9 531 392), 5 000)
LEAST((17 179 869 184 / 9 531 392), 5 000)
LEAST(1 802, 5 000)
1 802 simultaneous connexions

SQL Server

In AWS, by default, the maximum number of concurrent connections is unlimited.

I hope it will help you! 🍺


This content originally appeared on DEV Community and was authored by Maxime Guilbert


Print Share Comment Cite Upload Translate Updates
APA

Maxime Guilbert | Sciencx (2022-01-11T21:20:13+00:00) Choosing a database instance class in AWS with the maximum simultaneous connexions. Retrieved from https://www.scien.cx/2022/01/11/choosing-a-database-instance-class-in-aws-with-the-maximum-simultaneous-connexions/

MLA
" » Choosing a database instance class in AWS with the maximum simultaneous connexions." Maxime Guilbert | Sciencx - Tuesday January 11, 2022, https://www.scien.cx/2022/01/11/choosing-a-database-instance-class-in-aws-with-the-maximum-simultaneous-connexions/
HARVARD
Maxime Guilbert | Sciencx Tuesday January 11, 2022 » Choosing a database instance class in AWS with the maximum simultaneous connexions., viewed ,<https://www.scien.cx/2022/01/11/choosing-a-database-instance-class-in-aws-with-the-maximum-simultaneous-connexions/>
VANCOUVER
Maxime Guilbert | Sciencx - » Choosing a database instance class in AWS with the maximum simultaneous connexions. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/11/choosing-a-database-instance-class-in-aws-with-the-maximum-simultaneous-connexions/
CHICAGO
" » Choosing a database instance class in AWS with the maximum simultaneous connexions." Maxime Guilbert | Sciencx - Accessed . https://www.scien.cx/2022/01/11/choosing-a-database-instance-class-in-aws-with-the-maximum-simultaneous-connexions/
IEEE
" » Choosing a database instance class in AWS with the maximum simultaneous connexions." Maxime Guilbert | Sciencx [Online]. Available: https://www.scien.cx/2022/01/11/choosing-a-database-instance-class-in-aws-with-the-maximum-simultaneous-connexions/. [Accessed: ]
rf:citation
» Choosing a database instance class in AWS with the maximum simultaneous connexions | Maxime Guilbert | Sciencx | https://www.scien.cx/2022/01/11/choosing-a-database-instance-class-in-aws-with-the-maximum-simultaneous-connexions/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.