redis resource_error ai_generated true

ERR: Command queue full for client, dropping connection

ID: redis/command-queue-full

Also available as: JSON · Markdown · 中文
80%Fix Rate
82%Confidence
1Evidence
2024-01-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
Redis 6.2 active
Redis 7.0 active
Redis 7.2 active

Root Cause

A client's command buffer exceeded the client-output-buffer-limit, causing Redis to disconnect it to prevent memory exhaustion.

generic

中文

客户端的命令缓冲区超过了客户端输出缓冲区限制,导致 Redis 断开连接以防止内存耗尽。

Official Documentation

https://redis.io/docs/latest/develop/reference/clients/

Workarounds

  1. 80% success Check the client's application logic: use pipelining or batching to reduce the number of commands sent per connection. Example: in Python, use redis-py pipeline.
    Check the client's application logic: use pipelining or batching to reduce the number of commands sent per connection. Example: in Python, use redis-py pipeline.
  2. 70% success Monitor slow consumers with CLIENT LIST and consider increasing client-output-buffer-limit for specific client types: CONFIG SET client-output-buffer-limit 'normal 0 0 0' (reset to default).
    Monitor slow consumers with CLIENT LIST and consider increasing client-output-buffer-limit for specific client types: CONFIG SET client-output-buffer-limit 'normal 0 0 0' (reset to default).

中文步骤

  1. 检查客户端的应用程序逻辑:使用管道或批处理减少每个连接发送的命令数量。例如:在 Python 中使用 redis-py 的 pipeline。
  2. 使用 CLIENT LIST 监控慢消费者,并考虑增加特定客户端类型的客户端输出缓冲区限制:CONFIG SET client-output-buffer-limit 'normal 0 0 0'(重置为默认值)。

Dead Ends

Common approaches that don't work:

  1. Increase client-output-buffer-limit to a very high value (e.g., 1GB) 45% fail

    May hide the underlying issue (e.g., slow consumer or large replies) and risk OOM on Redis server.

  2. Restart Redis server to clear all client connections 60% fail

    Temporary fix; the issue will recur if the client behavior isn't changed.