Open ashok-mariyala opened 1 month ago
@ashok-mariyala The code looks awfully similar to the code in #3838 and #3844. Is the exception mentioned there resolved?
@sazzad16 Thank you for the quick response. As you mentions, #3838 and #3844 these 2 tickets used JedisPool where as I am using JedisPooled class. BTW Those are not related to my application codebase. I have taken above tickets reference few days back may be due to that you observed similar code base. Kindly please help me, what might be issue in my code base. Thanks in advance.
You are using new JedisPooled("redis", 6379, timeout, "default", "Ashok@Redis")
constructor which uses the default pool config of size 8. As you are performing huge write and read operations, you should allow a larger pool size. You can do that by GenericObjectPoolConfig<Connection>
(or simply ConnectionPoolConfig
). You can learn more about pool configuration by studying apache commons pool version 2. Here is a short guide on Configuring Connection pool.
@sazzad16 Sure I will try to increase the pool size. Could you please suggest me, what is suggestable connection pool recommendation (max total, min idle, max idle) for production grade for huge writes and reads. Thanks in advance.
@ashok-mariyala Sorry, I can't. These depend on application, system, network, design, strategy, etc. You would have to tune accordingly.
If you have a huge number of operations, the number of connections could be one thousand or even several thousands.
Expected behavior
Java Jedis client work with thousands of reads and write on redis server.
Actual behavior
Jedis client gives
Could not get a resource from the pool
error while performing huge write and read operations on redis clientStack trace
Steps to reproduce:
Please create a reproducible case of your problem. Make sure that case repeats consistently and it's not random
Java Code Snippets Redis connection initialization
Inserting data to the redis server
Redis / Jedis Configuration
Jedis version:
4.4.3
Redis version:
redis:7.2.4-debian-11-r0
Java version:
11.0.20.1