Slowness in Redis Client When using Azure Cache For Redis - redisinputstream.ensurefill

71 Views Asked by At

We are using Azure Cache for Redis with 1 GB Standard Tier. Under higher load like 400 Concurrent in the application users Redis Write is becoming slow and also I am noticing slowness performance from same common method of redis client

 Class  redis.clients.jedis.util.RedisInputStream
Method  ensureFill

When cache is used it has 3 steps. Get the connection from pool, read/write and close connection. Above ensurefill is used on all 3 step which is strange.

Please see the call tree screeeshots below.

If you notice in all the steps of any cache retrieval, get resource from pool, get and close 3 methods endsup calling same redisinputstream.ensurefill, and all of time it is the most timeconsuming method.

My question is what is this method and why it has to be called all 3 times while once the connection is retrieve from the pool only should be simple read/write. Even for closing connection also it is calling ensurefill method.

enter image description here

enter image description here

enter image description here

Here is my pool config.

private static GenericObjectPoolConfig<Jedis> buildPoolConfig() {
    final JedisPoolConfig poolConfig = new JedisPoolConfig();
    poolConfig.setMaxTotal(200);
    poolConfig.setMaxIdle(100);
    poolConfig.setMinIdle(20);
    poolConfig.setTestOnBorrow(true);
    poolConfig.setTestOnReturn(true);
    poolConfig.setTestWhileIdle(true);
    poolConfig.setMinEvictableIdleTimeMillis(Duration.ofSeconds(100).toMillis());
    poolConfig.setTimeBetweenEvictionRunsMillis(Duration.ofSeconds(100).toMillis());
    poolConfig.setNumTestsPerEvictionRun(3);
    poolConfig.setBlockWhenExhausted(true);
    return poolConfig;
}
0

There are 0 best solutions below