mysql resolves the sleep process

Source: Internet
Author: User

In Web scripting, some calculations and applications can be time-consuming, such as opening a database in 0 seconds after the execution of a SQL code, the page script takes 20 seconds to perform a complex operation, or require a large PHP file (such as a filter function with thousands of offending keywords), This time in the MySQL background to see the process, this 20-second process of MySQL did not do anything, has been in sleep state, until this page executed or reached the Wait_timeout value (forcibly closed), optimize the page script, try to get the program to run quickly, or during the execution of this time-consuming run, execute mysql_close to force the current MySQL link to close

1. Is to modify the configuration my.cnf

wait_timeout=10

Restart MySQL (not recommended)

2. is directly into MySQL

setglobalwait_timeout=10;

show globalvariables like‘%timeout‘

mysql resolves the sleep process

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.