Set the maximum number of connections on the MySQL server

Source: Internet
Author: User
Tags mysql view

The number of connections on the MySQL server is not as good as 100% of the maximum number of connections. For more information, see the following section.

We often encounter "MySQL: ERROR 1040: Too connections". One is that the access traffic is indeed high and the MySQL server cannot resist it. In this case, we need to consider increasing the load on distributed reads from the server, the value of max_connections In the MySQL configuration file is too small:

Mysql> show variables like 'max _ connections ';
+ ----------------- + ------- +
| Variable_name | Value |
+ ----------------- + ------- +
| Max_connections | 256 |
+ ----------------- + ------- +

The maximum number of connections on this MySQL server is 256, and then query the maximum number of connections on the server response:

Mysql> show global status like 'max _ used_connections ';

In the past, the maximum number of connections on the MySQL server was 245, but the maximum number of connections on the server was 256. There should be no 1040 error. The ideal setting is:

Max_used_connections/max_connections * 100% ≈ 85%.

The maximum number of connections accounts for about 85% of the maximum number of connections. If the percentage is less than 10%, the connection to the MySQL server is too high.

Mysql multi-Table query implementation

Take you to understand mysql Variables

How to revoke permissions and delete MySQL users

How to implement a dynamic MySQL View

How to deal with MySQL function creation Problems

Related Article

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.