Search code examples
redisjedis

Increasing Pool size in JEDIS will affect redis performance?


Consider a scenario my application needs only 100 jedisPool connections to fetch data from redis server. What happen if I configure 500 as max pool size keeping in mind that my application needs more connections in future. Does it affect the redis performance. If yes, what is the severity of this problem?

Thanks in advance


Solution

  • The default max clients for Redis is 10000, you can check it with CONFIG GET maxclients. So if you ever get to 500 connections is quite manageable. If you will have multiple Jedis clients then consider the product nodes*maxTotal. See https://redis.io/topics/clients

    You can expect a soft performance decrease as your number of clients increases. You probably want to run some benchmarks.

    I tried redis-benchmark -t set -r 100000 -n 1000000 -c 500 where -c 500 is the number of clients. From 50 to 500 clients I got a 12% decrease in requests-per-second.

    Check this out for JedisPool optimization.