MySQL show processlist; a lot of sleep command

Source: Internet
Author: User
Show Processlist; Looking at the next, we found that there are 10 rows, which means 10 database connections are not closed? Can you just end the command for sleep? Using PHP to connect to the database requires each call plus mysql_close (), I read the manual said no need, really?

Reply content:

Show Processlist; Looking at the next, we found that there are 10 rows, which means 10 database connections are not closed? Can you just end the command for sleep? Using PHP to connect to the database requires each call plus mysql_close (), I read the manual said no need, really?

Brother, read this article http://blog.chinaunix.net/uid-134240-id-220211.html as long as you put the connection in the code, you don't have to be afraid, of course, if you add a connection pool, you do not have to tube. This blog is believed to have what you want.

The first column of show Processlist is the ID, and you can execute the kill ID directly to kill the corresponding thread.

  • 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.