Fractal Techware

Alert runbooks /

RedisMemoryHigh

Redis is using nearly all of the memory allowed by its maxmemory setting.

   
Severity warning
Source oliver006/redis_exporter 1.50+
Key metrics redis_memory_used_bytes, redis_memory_max_bytes

What it means

The alert compares used memory with the configured maxmemory and fires when usage has stayed close to the limit for several minutes. Instances without a maxmemory limit are ignored (they can still be killed by the OS or container limit, which this alert cannot see).

What happens at the limit depends on maxmemory-policy. With noeviction, writes fail with OOM command not allowed when used memory > 'maxmemory'. With an allkeys-* or volatile-* policy, Redis evicts keys, which is fine for a pure cache but data loss for anything else.

Common causes

First checks

  1. Read the memory breakdown and the policy:
    redis-cli -h <host> INFO memory | grep -E '^(used_memory_human|used_memory_rss_human|maxmemory_human|maxmemory_policy|mem_fragmentation_ratio|mem_clients_normal)'
    redis-cli -h <host> CONFIG GET maxmemory-policy
    
  2. Ask Redis for its own diagnosis:
    redis-cli -h <host> MEMORY DOCTOR
    
  3. Find the largest keys (uses SCAN, safe on production but adds some load):
    redis-cli -h <host> --bigkeys
    redis-cli -h <host> --memkeys
    
  4. Check how many keys lack an expiry, per database:
    redis-cli -h <host> INFO keyspace
    

    Compare keys= with expires= for each db.

  5. Look at the growth trend to estimate time to full:
    deriv(redis_memory_used_bytes[1h])
    

Fixing it

Short term, raise maxmemory with CONFIG SET maxmemory <bytes> if the host or container has headroom (keep room for fork during persistence). Delete or trim unbounded keys with UNLINK rather than DEL to avoid blocking. Longer term, add TTLs, cap collections, choose a policy that matches the use case, and shard or scale up.