OOM
data
resource_error
ai_generated
true
Redis OOM command not allowed when used memory > 'maxmemory'
ID: data/redis-oom-command-not-allowed
87%Fix Rate
89%Confidence
1Evidence
2023-08-12First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Redis 6.2 | active | — | — | — |
| Redis 7.0 | active | — | — | — |
| Redis 7.2 | active | — | — | — |
Root Cause
Redis reaches its configured maxmemory limit and the eviction policy is set to noeviction, causing write commands to fail with OOM error.
generic中文
Redis达到配置的maxmemory限制,且逐出策略设置为noeviction,导致写入命令因内存不足而失败。
Official Documentation
https://redis.io/docs/latest/operate/oss_and_stack/management/admin/#maxmemoryWorkarounds
-
93% success Change the eviction policy to allkeys-lru to automatically evict least recently used keys when memory is full.
Change the eviction policy to allkeys-lru to automatically evict least recently used keys when memory is full.
-
85% success Add more RAM to the server and increase maxmemory to a safe limit below total RAM.
Add more RAM to the server and increase maxmemory to a safe limit below total RAM.
中文步骤
Change the eviction policy to allkeys-lru to automatically evict least recently used keys when memory is full.
Add more RAM to the server and increase maxmemory to a safe limit below total RAM.
Dead Ends
Common approaches that don't work:
-
85% fail
Without setting an eviction policy, Redis will fill up again quickly.
-
75% fail
If the system has no free RAM, Redis will swap to disk, severely degrading performance.