This afternoon, the website continued to encounter database connection failures. It would be better to restart mysql, but after a while, the database connection failure may occur. Check monitorix and find an exception. Ask tech experts for help. The first time you encounter such a problem, GoogleAnalytics displays...
This afternoon, the website continued to encounter database connection failures. It would be better to restart mysql, but after a while, the database connection failure may occur.
Check monitorix and find an exception. Ask tech experts for help. If you encounter such a problem for the first time, GoogleAnalytics shows that the real-time traffic is about 100, which is not normal.
Please advise!
Reply content:
This afternoon, the website continued to encounter database connection failures. It would be better to restart mysql, but after a while, the database connection failure may occur.
Check monitorix and find an exception. Ask tech experts for help. If you encounter such a problem for the first time, GoogleAnalytics shows that the real-time traffic is about 100, which is not normal.
Please advise!
If your PHP uses persistent connections to access MySQL (A PHP-FPM process keeps a MySQL persistent connection, eliminating the overhead of repeatedly establishing a connection each request), then the number of PHP-FPM processes pm. max_children should not exceed the maximum number of connections of MySQL max_connections (151 by default ). if you are using Apache, the number of httpd processes should not be more than the maximum number of connections of MySQL.
Some queries may encounter performance problems as data increases, resulting in many SQL statements being blocked. You can run the following command to view the current SQL statement.
show full processlist;
In addition, you can enable MySQL slow query logs to record time-consuming queries and then optimize them.
Another case is that the hard disk is full.