When we close the Jedis connection, it closes on client side but on server connection is still in ESTABLISHED mode. connections are never getting closed on server for the same client and it keeps growing. And we are getting redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException:
when we run netstat on client it shows only 4 connections alive (ESTABLISHED ) but when we do netstat on redis server we see 900 connection in ESTABLISHED state with the same client.
CLIENT LIST on redis server also shows 900 connections ilde for days.
redis.with.sentinel = true
redis.pool.connection.timeout.millis=10000
redis.pool.max.total=100
redis.pool.max.idle=25
redis.pool.min.idle=10
redis.pool.max.wait.seconds=5000
GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
poolConfig.setMaxTotal(maxTotal);
poolConfig.setMaxIdle(maxIdle);
poolConfig.setMinIdle(minIdle);
poolConfig.setMaxWaitMillis(maxWaitInSeconds*1000);
pool = new JedisSentinelPool(clusterName, sentinels,poolConfig,timeoutInMillis);
Client code to access resource from redis:
try (Jedis jedis = pool.getResource()) {
jedis.get(key);
}catch (Exception e) {
}
Why is redis server still keeping all the connections ESTABLISHED even though client has closed it.
Client host:
Even after setting timeout value to 7200 in redis.conf, I am still seeing all those connections open in sentinel 6379. Timeout should have closed all idle connections only pub/sub are not closed but we are not using pub/sub.
Is there any other setting for JedisSentinel to close idle connections ?
I have observed that most of the open connections are for sentinel which is running on port 6379 on slave host in cluster
Redis Server sentinel client list:
why I have all client connection CMD=subscribe ?
From client code i am not using pub/sub model for getting connection.
Please suggest why so many connections are in open state. We are not using any load balancers or proxy.
ticket open at : https://github.com/xetorthio/jedis/issues/2038
whenExhaustedAction is by default set to WHEN_EXHAUSTED_BLOCK . And we are already using maxWait property.