Analysis of Mysql errors caused by slow php logs. In our project, enabling PHP slow logs (request_slowlog_timeout10s) is a required option, and it also makes us find many pitfalls and solves many performance problems. Yesterday, in our project, enabling PHP slow logs (request_slowlog_timeout = 10 s) was a required option, and it also made us discover many pitfalls and solved many performance problems.
Yesterday, due to a very strange problem, we had to disable the PHP slow log. what is the problem?
Problem: When the program is executed, 2013 (Lost connection to MySQL server during query) is reported)
Analysis:
1) in our background program, a loop (> 300 times) will be executed, and an SQL statement will be executed repeatedly in the loop;
2) Nginx access logs. each execution time of the program is about 12 seconds;
3) modify the mysql connection class. before querying, executing mysql_ping is also invalid, and the problem persists;
Just as I couldn't explain it, I thought, shut down the php slow log and try again. as you can imagine, the problem is quite good ....
As for the reason, I really don't know!
Commit (request_slowlog_timeout = 10 s) is a required option, and it also allows us to discover many pitfalls and solve many performance problems. Yesterday...