Redis: client scheduled to be closed ASAP for overcoming of output buffer limits is a warning in the Redis log, not an error a client sees. It means Redis had queued more unread replies for one connection than client-output-buffer-limit allows for that type of client, and dropped the connection to protect its own memory.
# Warning in the Redis log (shortened)
Client id=8812 addr=10.0.2.17:48212 ... flags=S ... omem=268435456 tot-mem=... cmd=psync ...
scheduled to be closed ASAP for overcoming of output buffer limits.
The interesting part is the client description in the middle. networking.c prints the same fields as CLIENT LIST: flags tells you the client type (S for a replica, P for a Pub/Sub subscriber, O for MONITOR), omem is the output buffer memory, and cmd is the last command. A line with flags=S and cmd=psync is a replica; that is the case that hurts most.
How the limit works
The redis.conf defines three client classes, each with a hard limit, a soft limit and a number of seconds:
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
- Hard limit: the client is disconnected as soon as its output buffer reaches it.
- Soft limit: the client is disconnected if the buffer stays above it continuously for the given number of seconds.
- normal clients, which include
MONITOR, are unlimited by default, because they normally get data only in reply to their own requests. replica and pubsub clients receive data pushed by the server, so they have default limits. - A zero disables a limit. Valkey ships the same three defaults.
The same check also caps unauthenticated connections: in the current source, a client that has not authenticated yet is disconnected once more than 1024 bytes of replies are queued for it.
Case 1: a replica in a full sync loop
This is the classic incident. A replica connects and asks for a partial resync. If the primary's backlog no longer holds the data it is missing, the replication documentation describes what happens next: a full resynchronization. The primary forks to produce an RDB snapshot and buffers every new write for that replica until the snapshot has been transferred and loaded.
On a large dataset with steady writes, that buffer grows for the whole duration of the fork, the transfer and the load. With the default replica limits it is disconnected when it reaches 256MB, or when it stays above 64MB for 60 seconds. The replica reconnects, asks again, gets another full sync, and the loop starts over. Meanwhile the primary forks again and again, which costs CPU, memory and latency. In our experience this is one of the most common reasons a replica stays at master_link_status:down for hours after a restart or a network blip, while the primary's log fills with this warning.
The fix is to give that one sync enough room to finish:
- Raise the replica limits above the write volume the primary receives during a full sync. A rough estimate is the write rate in bytes per second multiplied by the time a full sync takes (fork, transfer, load), plus a margin.
- Raise
repl-backlog-size(1MB by default in redis.conf) so that short disconnects end in a partial resync instead of a full one. The backlog must cover the writes made during the longest outage you want to survive without a full sync. redis.conf also warns not to set the replica buffer limits belowrepl-backlog-size. - Make the sync faster. A smaller dataset, a faster network and faster disks on the replica all shorten the window in which the buffer grows.
# give replicas room during the next full sync (runtime, then persist)
redis-cli CONFIG SET client-output-buffer-limit "replica 1gb 512mb 120"
redis-cli CONFIG SET repl-backlog-size 256mb
redis-cli CONFIG REWRITE
Newer versions also move part of this buffering to the replica. In Redis 8.0 the primary can send the RDB file and the replication stream in parallel during a full sync, and replica-full-sync-buffer-limit limits how much the replica accumulates. Valkey has a similar option, dual-channel-replication-enabled, which is off by default and requires diskless sync on the primary. Either way, the primary's replica limit still applies once the replica stops accumulating.
Case 2: a slow Pub/Sub consumer
With flags=P the dropped client is a subscriber that reads messages more slowly than they are published. Pub/Sub has no persistence: the messages queued for that connection are gone, and anything published while it reconnects is missed. Raising the 32MB/8MB/60s limit only buys time; if the consumer is permanently slower than the producer, the buffer grows until it hits any limit you set, or until Redis runs out of memory. Fix the consumer (process in another thread, scale out), or use Redis Streams, where a consumer that falls behind can read later instead of losing data.
Case 3: normal clients and MONITOR
Normal clients are unlimited by default, so this warning for flags=N or flags=O means someone set a limit on the normal class. Without one, a client that requests a huge reply and reads it slowly, or a MONITOR session on a busy server, can make Redis hold a lot of memory for that connection. Large replies usually come from big keys or commands like KEYS *; a modest normal-class limit protects the server, at the cost of breaking clients that legitimately need large replies.
Raising limits is a memory decision. Output buffers are allocated on top of your dataset. Size maxmemory and the instance's RAM so that the replica limit times the number of replicas that may full-sync at once still fits, together with the extra memory a fork can use for copy-on-write.
Diagnosing it
# on the primary: is the replica stuck in full syncs?
redis-cli INFO stats | grep -E 'sync_full|sync_partial_ok|sync_partial_err|client_output_buffer_limit_disconnections'
redis-cli INFO replication
redis-cli INFO memory | grep -E 'used_memory_human|mem_clients_slaves|mem_clients_normal'
# who is holding large output buffers right now?
redis-cli CLIENT LIST TYPE pubsub
redis-cli CLIENT LIST TYPE replica
sync_fullgrowing steadily whilesync_partial_okstays flat is the loop from case 1;sync_partial_errcounts partial resync requests the primary refused.- INFO stats has
client_output_buffer_limit_disconnectionson Redis 7.4 and later and on Valkey 8.0 and later. Graph it; any increase deserves a look. - Since Redis 7.0 replica buffers share memory with the replication backlog, so
mem_clients_slavescan show 0 even with replicas connected, as the INFO documentation notes. - On the replica,
master_link_statusandmaster_sync_in_progressinINFO replicationtell you whether it is stuck syncing. The read-only replica guide covers other replica states you may see.
On large datasets
Everything in case 1 gets worse with size. A full sync of a 50GB dataset takes far longer than one of 2GB, so the replica buffer has to absorb many more writes, and every failed attempt costs another fork of a large process.
- Size from measurements. Measure a full sync once in a controlled window, from fork to
master_link_status:up, and multiply by your peak write rate. In our experience teams that size from the average write rate get caught by the nightly batch job. - Stagger replica restarts. Several replicas doing a full sync at once each need buffer space on the primary. Restart and resync them one at a time.
- Change limits before the incident.
CONFIG SETworks at runtime, but if a replica is already looping, it needs one successful sync under the new limits. Persist changes withCONFIG REWRITEor in your config management, or they vanish on the next restart. - Watch failover side effects. With Sentinel or a cluster, a replica that never finishes syncing does not hold current data and is a poor failover target. In our experience a sync loop on the only replica quietly removes your high availability.
Key takeaways
- The warning means a client's unread replies passed
client-output-buffer-limitfor its class; the log line tells you which client and type. - Defaults: normal unlimited, replica 256MB hard and 64MB for 60 seconds, pubsub 32MB hard and 8MB for 60 seconds.
- For replicas it usually means a full sync loop: raise the replica limits and
repl-backlog-sizeso one sync can finish. - For Pub/Sub it means a consumer slower than the producer and lost messages; fix the consumer or move to Streams.
- Watch
sync_full,sync_partial_errandclient_output_buffer_limit_disconnections, and budget RAM for the buffers you allow.