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