RDS does not have constraints on the number of connections. This number is determined by the default value and value range of the DB engine. For example, you can set max_connections and max_user_connections in a parameter template to configure the maximum number of connections for an RDS for MySQL DB instance.
.
You can change the maximum number of connections using commands.
Check the maximum number of files that can be opened by a single process in the operating system. The default value is 1024.
ulimit -n
The parameter open_files_limit indicates the maximum number of files that can be opened by a single process, which is read from the operating system during MySQL startup.
Check the value of open_files_limit.
show variables like 'open_files_limit';
The maximum number of MySQL connections can be customized provided that it is allowed by your instance specifications. The maximum number of connections is closely related to the instance memory. For details, see About max_connections.
In actual scenarios, set the maximum number of connections to an appropriate value because more connections lead to large resource consumption.
max_connections: maximum number of clients that can be connected at the same time. If this parameter is set to default, it is related to the memory (unit: GB) of the DB instance. The calculation 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 |