MySQL optimization small case: number of connections

Source: Internet
Author: User

Error code: Mysql:error 1040:too Many connections

Often encounter this error, either business growth, normal traffic increase, or your own max_connections settings are too small

To view the maximum number of connections for a system max

mysql> SHOW VARIABLES like ' max_connections ';

  

View the maximum number of connections processed before the system used

Mysql> SHOW GLOBAL STATUS like '%max_used_connections% ';

  

General used/max≈80% is more ideal.

To set the size of a connection:

mysql> SET GLOBAL max_connections = 200; Query OK, 0 rows Affected (0.00 sec)

But after the reboot, it was dead. If the requirement is not changed, it can be modified in my.cnf.

MySQL optimization small case: number of connections

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.