Home > Article > Backend Development > Analysis of Mysql errors caused by PHP's slow log_PHP Tutorial
In our project, turning on PHP's slow log (request_slowlog_timeout = 10s) is a must, and it also allowed us to discover many pitfalls and solve many performance problems.
We encountered a very strange problem yesterday, which forced us to turn off the PHP slow log. What was the problem?
Problem: When executing the program, 2013 (Lost connection to MySQL server during query) will be reported
Analysis:
1) In our background program, a Loop (>300 times), a SQL statement will be repeatedly executed in the loop;
2) Nginx access log, each execution time of the program is about 12 seconds;
3) Modify the mysql connection class, query Before, executing mysql_ping also failed, and the problem remained;
When I was puzzled, I thought, try turning off the php slow log. As you can imagine, the problem was solved. ...
As for the reason, I really don’t know, please tell me the truth!