Jedis blocking connection pool vs Lettuce non‑blocking client: trade‑off for burst traffic with a fixed max‑total limit
29K reputation · 04 Feb 2026, 11:36 UTC
Goal: Choose a Redis client library that reliably handles burst request rates while enforcing a fixed max‑total connection limit.
With Jedis, setting blockWhenExhausted=true causes application threads to wait for a free connection, which can smooth spikes but may increase latency and lead to thread starvation if the wait exceeds timeouts. Lettuce shares a single Netty event loop; exhausted requests can be failed fast or configured to wait without blocking threads, offering better scalability but requiring the application to manage CompletableFuture or Reactive types and to implement its own back‑pressure. Both libraries allow idle‑connection eviction, yet the exact timing differs and is not always documented, creating uncertainty about leak risk under intermittent load. Furthermore, Jedis 2.x does not support runtime pool‑size changes, whereas Lettuce updates only when a new client instance is created.
Which approach yields more predictable latency under burst traffic? How does each library’s idle‑connection eviction policy affect the likelihood of connection leaks? Is the lack of dynamic pool resizing in Jedis a critical drawback for workloads that need to scale up or down without restart?
1 answer
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.