Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The number of Mysql connections is inconsistent with the profile

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

When deploying a physical machine, the developer reported that it could not connect to the database. Log in to the backend and found that the login failed and reported too many connections. Check the number of connections and query the maximum number of Mysql connections after restarting the database login:

Mysql > select @ @ max_connections

+-+

| | @ @ max_connections |

+-+

| | 214 |

+-+

1 row in set (0.00 sec)

Number of Mysql profile connections:

Max_connections = 3000

Log after Mysql restart:

2019-06-27T01:27:04.352761Z 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 65535)

2019-06-27T01:27:04.352836Z 0 [Warning] Changed limits: max_connections: 214 (requested 3000)

2019-06-27T01:27:04.352843Z 0 [Warning] Changed limits: table_open_cache: 400 (requested 4096)

View the system max_open_files as follows:

The normal database is as follows:

View the problem and see the corresponding process restrictions

Ps-ef | grep mysqld

View Resource Management

View the status of the user session

View the location configuration of the user session

Modify / lib/systemd/system/rc-local.service configuration file

Vi / lib/systemd/system/rc-local.service

LimitNOFILE=65535

Load the configuration file and restart the machine

Limits for viewing the largest file

Check the database log and find that there is no previous warning.

Check the maximum number of connections to the database, which has returned to normal

Mysql > show variables like 'max_conne%'

+-+ +

| | Variable_name | Value |

+-+ +

| | max_connect_errors | 500 | |

| | max_connections | 3000 | |

+-+ +

2 rows in set (0.00 sec)

So far, the problem that the number of connections to the profile is not valid has been completely dealt with.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report