Too many connections exceeded maximum number of connections in MySQL

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.