ERR redis resource_error ai_generated partial

流 'mystream' 上消费者组 'mygroup' 的待处理条目列表 (PEL) 过大

ERR PEL too large for consumer group 'mygroup' on stream 'mystream'

ID: redis/stream-consumer-group-pending-entries-overload

其他格式: JSON · Markdown 中文 · English
75%修复率
85%置信度
1证据数
2024-03-15首次发现

版本兼容性

版本状态引入弃用备注
7.0 active
7.2 active
8.0-m3 active

根因分析

消费者组的待处理条目列表 (PEL) 增长过大,超出了 Redis 内部限制或导致性能下降。

English

The Pending Entries List (PEL) for a consumer group has grown excessively large, exceeding Redis internal limits or causing performance degradation.

generic

官方文档

https://redis.io/docs/latest/commands/xreadgroup/

解决方案

  1. Use XACK to acknowledge processed messages and shrink the PEL. Example: XACK mystream mygroup 1234567890-0 1234567891-0
  2. Use XAUTOCLAIM to reclaim idle pending messages and acknowledge them programmatically. Example: XAUTOCLAIM mystream mygroup other-consumer 3600000 0-0 COUNT 100
  3. Monitor and limit the number of pending entries per consumer by setting a maximum processing time and acknowledging messages promptly in application code.

无效尝试

常见但无效的做法:

  1. Delete and recreate the consumer group without acknowledging pending messages. 60% 失败

    This loses all pending messages and disrupts processing state; messages may be lost permanently.

  2. Increase the stream's max-length to a very high value. 80% 失败

    The PEL size is not directly tied to stream length; it depends on unacknowledged messages. Increasing max-length does not help.

  3. Restart the Redis server to clear the PEL. 90% 失败

    The PEL is persisted and will be restored on restart; this only causes downtime without solving the underlying issue.