Closed s-aravind-flipkart closed 3 years ago
ClientPolicy.maxConnsPerNode sets max connections for each server node. ClientPolicy.maxSocketIdle sets max seconds connections may remain idle in a connection pool.
There is no direct way to require a minimum number of connections. You can keep connections in the pool longer by increasing maxSocketIdle (default 55 seconds). If maxSocketIdle is increased, the default connection reap on the server (proto-fd-idle-ms, default 60000 ms) should also increase because maxSocketIdle should always be less than proto-fd-idle-ms. Otherwise, the client may attempt to use connections that have been closed by the server.
@BrianNichols Thanks for the info. This pool also includes for batch reads right. I see right now a lot of connections in TIMED_WAIT with default configs. Batch read size is large in my case around 80 ids per call.
Yes, batch reads use a connection for each target node from the node's connection pool.
ClientPolicy.minConnsPerNode has been supported for a while now.
Like in Jedis using GenericObjectPool there is a way to specify idle and max connections the client needs to create. Is there a similar way in java client to specify both aspects