Skip to main content

CRE-2025-0201

Redis Out-of-Memory Error - Maxmemory Limit ExceededCritical
Impact: 10/10
Mitigation: 8/10

CRE-2025-0201View on GitHub

Description

Detects Redis out-of-memory errors when the maxmemory limit is reached and the configured eviction policy prevents new writes. This typically occurs when Redis is configured with 'noeviction' policy and memory usage exceeds the maxmemory setting, causing all write commands to fail.\n

Mitigation

IMMEDIATE ACTIONS:\n- Check current memory usage: `redis-cli INFO memory | grep used_memory_human`\n- Review maxmemory setting: `redis-cli CONFIG GET maxmemory`\n- Check eviction policy: `redis-cli CONFIG GET maxmemory-policy`\n\nRECOVERY:\n- Option 1: Increase maxmemory limit\n `redis-cli CONFIG SET maxmemory 2gb`\n- Option 2: Change eviction policy\n `redis-cli CONFIG SET maxmemory-policy allkeys-lru`\n- Option 3: Manually delete unnecessary keys\n `redis-cli FLUSHDB` (WARNING: deletes all keys)\n- Option 4: Identify and remove large keys\n `redis-cli --bigkeys`\n\nPREVENTION:\n- Set appropriate maxmemory limit based on available RAM\n- Use eviction policies like allkeys-lru or volatile-lru\n- Monitor memory usage with Redis INFO command\n- Implement TTL on keys where appropriate\n- Regular memory usage auditing and capacity planning\n

References