Home  >  Article  >  Backend Development  >  Analysis of Mysql errors caused by PHP's slow log_PHP Tutorial

Analysis of Mysql errors caused by PHP's slow log_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:29:46793browse

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!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/769676.htmlTechArticleIn our project, turning on PHP’s slow log (request_slowlog_timeout = 10s) is a must, and it is also We discovered many pitfalls and solved many performance problems. Yesterday by...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn