Sizing the connection pool

We need to work with the following attributes to size the connection pool:

  • initialSize: The initialSize attribute defines the number of connections that will be established when the connection pool is started.
  • maxActive: The maxActive attribute can be used to limit the maximum number of established connections to the database.
  • maxIdle: The maxIdeal attribute is used to maintain the maximum number of idle connections in the pool at all times.
  • minIdle: The minIdeal attribute is used to maintain the minimum number of idle connections in the pool at all times.
  • timeBetweenEvictionRunsMillis: The validation/cleaner thread runs every timeBetweenEvictionRunsMillis milliseconds. It's a background thread that can test idle, abandoned connections, and resize the pool while the pool is active. The thread is also responsible for connection leak detection. This value should not be set below 1 second.
  • minEvictableIdleTimeMillis: The minimum amount of time an object may sit idle in the pool before it is eligible for eviction.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset