RDS does not have constraints on how many connections are supported. It depends on the default values and value ranges of the following parameters: max_connections and max_user_connections for the MySQL DB engine and max_connections for the PostgreSQL DB engine. You can customize these parameters in a parameter template.
The maximum number of connections refers to the concurrent connections allowed for a DB instance.
You can run the following command to query the maximum number of connections allowed:
show global variables like 'max_connections';

You can run the following command to query the maximum number of connections allowed:
show max_connections;

ulimit -n

show variables like 'open_files_limit';

The maximum number of RDS for MySQL connections can be modified to any amount allowed by your instance specifications. The maximum number of connections supported is closely related to the instance memory.
max_connections: maximum number of concurrent connections to a DB instance. If this parameter is set to default, the maximum number of connections depends on the memory (unit: GB) of the DB instance. The formula is as follows:
Estimated value of max_connections = Available node memory/Estimated memory occupied by a single connection
The following table lists the default values of max_connections for different memory specifications.
Memory (GB) | Connections |
|---|---|
512 | 100,000 |
384 | 80,000 |
256 | 60,000 |
128 | 30,000 |
64 | 18,000 |
32 | 10,000 |
16 | 5,000 |
8 | 2,500 |
4 | 1,500 |
2 | 800 |
Set the maximum number of connections to an appropriate value because more connections consume more system resources.
Set max_connections based on the complexity of your workloads.