Connection pool parameter configuration description

grails connection pool parameter configuration instructions

 

maxActive

The maximum number of connections supported by the connection pool, the value here is 20, which means that there are at most 20 database connections at the same time. Set 0 for no limit.

 

maxIdle

A maximum of maxIdle connections can be idle in the connection pool. The value here is 20, which means that even if there is no database connection, 20 idle connections can still be maintained without being cleared and in a standby state at any time. Set 0 for no limit.

 

minIdle

Minimum idle maxIdle connections in the connection pool 

 

initialSize

Number of initial connections 

 

maxWait

When the connection in the connection pool is used up, the new request wait time, milliseconds, the value here is -1, which means infinite wait until the timeout, or the value 9000, which means the timeout after 9 seconds. If the time is exceeded, an error message will be displayed

 

Generally, maxActive is set to the possible concurrency.

 

timeBetweenEvictionRunsMillis  timeBetweenEvictionRunsMillis is used together with minEvictableIdleTimeMillis to check the idle connections in the connection pool every  timeBetweenEvictionRunsMillis milliseconds and disconnect the connections whose idle time exceeds minEvictableIdleTimeMillis milliseconds until the number of connections in the connection pool reaches minIdle 

 

minEvictableIdleTimeMillis

The time that the connection in the connection pool can be idle, milliseconds 

 

removeAbandoned true,false

Whether to clean up active connections that are not used in removeAbandonedTimeout seconds, and are not put back into the connection pool after cleaning 

 

removeAbandonedTimeout Maximum idle time for active connections 

logAbandoned true,false , whether to print a message when the connection pool reclaims idle active connections 

 

minEvictableIdleTimeMillis, removeAbandonedTimeout

The connection objects for these two parameters are different, minEvictableIdleTimeMillis is for connection objects in the connection pool, and removeAbandonedTimeout is for active connections that have not been closed.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326208740&siteId=291194637