Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
The following code contains
if (timeSinceLastActive > connectionCleanupPeriodMs || active < MIN_ACTIVE_RATIO * total) { // Remove and close 1 connection List<ConnectionContext> conns = pool.removeConnections(1); for (ConnectionContext conn : conns) { conn.close(); } LOG.debug("Removed connection {} used {} seconds ago. " + "Pool has {}/{} connections", pool.getConnectionPoolId(), TimeUnit.MILLISECONDS.toSeconds(timeSinceLastActive), pool.getNumConnections(), pool.getMaxSize()); } ... if (pool.getNumConnections() < pool.getMaxSize() && active >= MIN_ACTIVE_RATIO * total) { ConnectionContext conn = pool.newConnection(); pool.addConnection(conn); } else { LOG.debug("Cannot add more than {} connections to {}", pool.getMaxSize(), pool); }
It affects cleanup and creating Connections. Maybe it should be configurable so that we can reconfig it to improve performance