Too many PAIP. MYSQLSLEEP connections

Source: Internet
Author: User

Solve the Problem of too many PAIP. mysql sleep connections

/////// Server method.

----------------- Set mysql to automatically disconnect. sleep connection ..

Configuration parameters interactive_timeout and wait_timeout in MySQL (two parameters that may lead to too many sleep processes)

1) interactive_timeout:

Parameter description: The number of seconds before the server closes the interactive connection. Interactive clients are defined as clients that use the CLIENT_INTERACTIVE option in mysql_real_connect.

Default Value of the parameter: 28800 seconds (8 hours)

(2) wait_timeout:

Parameter description: The number of seconds waiting for activity before the server closes a non-interactive connection.

When a thread starts, the wait_timeout value of the session is initialized based on the global wait_timeout value or the global interactive_timeout value, depending on the client type (defined by the CLIENT_INTERACTIVE connection option of mysql_real_connect ).

Default Value of the parameter: 28800 seconds (8 hours)

-------------------- Kill the connection ..

Paip. mysql batch kill connections)

//// // Client method.

Conn cannot be released on its own unless the connection pool is used.

------------ C3p0 database pool timeout settings .. minConn = 0

7: // Maximum idle time for C3P0 connection pool

8: public static final String C3P0_TIMEOUT = "hibernate. c3p0. timeout ";

-------------------- Manual conn. close

If the pool is not used, you can only close it manually. There is no parameter to set the maximum time of conn ..

----------- Process Termination... automatic release of gc conn

Related Article

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.