Solution to Too connector connections in MySQL

Source: Internet
Author: User

Because there are Too many online mysql instances, the Too connector connections problem is often encountered. This problem is also the most common problem. The following describes the solutions to this problem based on your own experience.

When this problem occurs, the business has encountered a problem. In this case, the most important thing is to restore the business first, in addition, you must first obtain the show innodb status and show full processlist information to analyze the cause. The simplest way is to temporarily increase the number of connections so that you can log on to the server. In this case, the Too worker connections prompt appears during login. What should I do? At this time, you can write an endless loop on the master to connect to the master mysql to ensure that you can log on normally. The simple statement is as follows:

While true; do mysql-uroot-ppassword-S/tmp/mysql_3306.sock; done

Then, use the gdb tool to change the max_connections configuration in the memory. Use the following command to find the mysql process ID:

Gdb-p 21862-ex "set max_connections = 1000"-batch

Note: Do not set max_connections to be too large. If it is too large, the system memory may be exhausted.

After logging on to the system, you can use show full processlist to check what happened. Generally, SQL is blocked and kill the corresponding SQL. You need to analyze and locate the problem together with the development of a large number of requests in a short time.

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.