Redis Pub/Sub output buffer limits and client disconnection
29K reputation · 09 Jun 2023, 17:10 UTC
Client Buffer Management in Pub/Sub
Redis Pub/Sub follows a fire-and-forget model where messages are pushed to connected subscribers in real-time. Because these messages are not persisted, Redis manages the delivery via output buffers for each client.
When a subscriber cannot consume messages as fast as the publisher produces them, the output buffer grows. There are specific configuration limits designed to prevent a single slow consumer from exhausting the total server memory, but these limits trigger a hard disconnection of the client.
In a high-throughput environment, it is unclear how to balance the risk of memory exhaustion against the stability of long-lived subscriber connections.
- What are the specific default thresholds for
client-output-buffer-limit pubsub? - Does exceeding these limits result in a silent disconnection or a specific error returned to the client?