Many Magento stores use Redis for cache and sessions. If Redis reaches its memory limit while set to the noeviction policy, it refuses new writes. Magento treats that as a fatal error, so customers get error pages across the whole store at once.
What it looks like
- Error pages or “There has been an error processing your request” across the store.
- In
var/log/exception.logor the Redis log: “OOM command not allowed when used memory > ‘maxmemory'”. - It often starts at busy times, when the cache grows fastest.
Check your settings
redis-cli CONFIG GET maxmemory
redis-cli CONFIG GET maxmemory-policy
redis-cli INFO memory | grep used_memory_human
If the policy is noeviction and a maxmemory limit is set, Redis will refuse writes as soon as it is full.
How to fix it
For the Redis instance that holds Magento’s cache, switch to a policy that removes the least recently used entries when full:
sudo sed -i 's/^maxmemory-policy .*/maxmemory-policy allkeys-lru/' /etc/redis/redis.conf
sudo systemctl restart redis-server
redis-cli CONFIG GET maxmemory-policy
Under pressure, Redis now quietly drops old cache entries instead of failing. That costs a little speed, not the whole store.
On AWS ElastiCache, change maxmemory-policy in the parameter group instead of redis.conf.
Keep sessions separate
Do not use allkeys-lru on a Redis instance that also stores sessions. Under memory pressure it could remove active sessions, logging customers out and emptying their carts. Run sessions on a separate Redis instance with noeviction and enough memory, and use allkeys-lru only for cache.
Size it properly
If Redis is constantly full, it is too small for your catalog. Watch evicted_keys in redis-cli INFO stats. If it keeps climbing quickly, give Redis more memory.
Catch it automatically
MageMonitor checks for this every few minutes as part of its Cache Health checks, and alerts you by email, Slack or webhook the moment it appears, with the exact commands to fix it. See MageMonitor for Magento 2.
