MySQL Maximum connection number problem
In MySQL source code, the default maximum number of connections is 16384
{"Max_connections", Opt_max_connections, "The number of simultaneous clients allowed.", (gptr*) &max_connections, (gptr*) &max_connections, 0, Get_ulong, Required_arg, 100, 1, 16384, 0, 1, 0}, |
Appear too many connections problem, at this time there is no way to connect to MySQL to dynamically modify the max_connections, there is the possibility of this problem
1 Front-end application issues
It may be that the number of long connections in the front end or the speed of the traffic increases the number of connections
2 problems with the number of self-connection settings
How to Solve
1 set MySQL max_connections, interactive_timeout value, let MySQL to reclaim this part of the connection
2 Avoid long connections, use short connections
Processing methods that cannot be logged on
[Email protected]_03 ~]#!mysql
Mysql-uroot-p
Enter Password:
ERROR 1040 (HY000): Too Many connections
Temporary handling methods
Gdb-p $ (cat/data/3306/tmp/mysql.pid)-ex "Set max_connections=1100"--batch
You can log in again
Mysql> show global variables like ' max_conn% ';
+--------------------+-------+
| variable_name | Value |
+--------------------+-------+
| max_connect_errors | 10000 |
| max_connections | 1100 |
+--------------------+-------+
2 rows in Set (0.00 sec)
To maintain a principle max_user_connections < max_connections
Of course, if this version of Percona has its own method, the Thread_pool inside the Percona5.5 provides 2 parameters Extra_port and Extra_max_connections to reserve additional connections, Prevent the connection is full after we can not access the database for the corresponding management (specific)
Too many connections exceeded maximum number of connections in MySQL