PHP slow log caused by the MySQL error problem analysis _php tips

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.