In our project, opening PHP slow log (request_slowlog_timeout = 10s) is a must option, and it also allows us to find a lot of holes to solve a lot of performance problems.
Yesterday because of a very strange problem, let us have to close the PHP slow log, what is the problem?
Question: When executing the program, it will report 2013 (Lost connection to MySQL server during query)
Analysis:
1 in our background program, will execute a loop (>300 times), the loop will repeatedly execute a SQL statement;
2 Nginx Access log, the program every execution time, in about 12 seconds;
3 Modify the MySQL connection class, query, execution mysql_ping also ineffective, the problem remains;
While baffled, thought, shut down PHP slow log try, later, the situation, imagine, the problem is better ....
As for God horse reason, I really do not know, ask the truth!