In the case of tens of millions of data, how does mysql handle 1040 without modifying the configuration file? In the case of tens of millions of data, how does mysql handle 1040 without modifying the configuration file?
Reply content:
In the case of tens of millions of data, how does mysql handle 1040 without modifying the configuration file?
1040 indicates that the maximum number of connections has been exceeded. if you do not modify the configuration file, run the command in mysql shell.
Set global max_connections = 10000;
I understand that the subject actually wants to control the number of connections at the logic layer. for my personal opinions, see:
The client uses the database connection pool, which is the most basic and controls the number of connection pools. Generally, the number of application servers is about 10, so that 1000 connections can support 100 application servers.
Read/write splitting is clustered. The subject also said that the database itself can be expanded.
Vertically split the database and make it service-oriented. for example, if a user has a database, an order database, and a user service and an order service are designed, only the user service can access the user database, other applications read and write user data through user services. orders are similar.