So, currently in my JedisPoolConfig bean, I have the parameter testOnBorrow set to true. It appears this retrieving resources slower.
There was a scenario where Jedis took 30minutes to retrieve resources from Redis (calling methods (redis.clients.jedis.BinaryJedis:exists:144 and java.lang.Thread:sleep) several times before getting a resource or breaking away).
What I thought I could do was set parameter testOnBorrow to false to prevent PING calls to Redis before reading resources.
So, my questions (and I really hope I get answers) are:
Jedis testOnX
settings simply send a Redis PING command on certain scenarios. testOnBorrow
sends them when receiving a connection from the pool.
Disabling it will make your work with Redis faster, as you skip the validation which means one less TTL. Note that your app should know how to handle a bad connection object, but this is true also with the test enabled as the connection can close/drop also after the test and before your usage.
That said, 30 minutes is eternity, and most definitely not happening because you send a PING request. Make sure you return the connections to the pool once done, and make sure your pool size is large enough for your application usage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With