0

I have a function to create a jedispool,

    final JedisPoolConfig poolConfig = new JedisPoolConfig();
    poolConfig.setMaxTotal(25);
    poolConfig.setMaxIdle(20);
    poolConfig.setMinIdle(20);
    poolConfig.setTestOnBorrow(false);
    poolConfig.setTestOnCreate(true);
    poolConfig.setTestOnReturn(true);
    poolConfig.setTestWhileIdle(false);
    poolConfig.setMinEvictableIdleTimeMillis(-1);
    poolConfig.setTimeBetweenEvictionRunsMillis(-1); // don't evict
    poolConfig.setNumTestsPerEvictionRun(-1);
    poolConfig.setBlockWhenExhausted(false);
    poolConfig.setLifo(false);
    return poolConfig;

I am getting client from pool using below. I see there is high latency even in 100- 500 ms at times and some times at 30 ms to get the client from pool. I am testing with 52 rps with configuration of 20 idle connections & 25 max connections.. Capable to handle ~600rps.. Any idea like what causes latency? If there any tweak at pool level to validate?

    Instant instant = Instant.now();
    Instant getFromPool = null;
    try (final Jedis jedis = jedisPool.getResource()){
        getFromPool = Instant.now();
    }

1 Answers1

0

You can check the waiting threads and the maximum wait time using the following method in the pool.

jedisPool.getNumWaiters();
jedisPool.getMaxBorrowWaitTimeMillis()

But I think there's a problem with the network layer.

yeahseol
  • 377
  • 1
  • 6