Memory Fragmentation Amplifies Cache Eviction Pressure
warningHigh Redis memory fragmentation ratio (>1.5) causes actual memory usage to exceed redis.memory.maxmemory limits, triggering premature key evictions and reducing cache hit rates even when logical memory usage appears healthy.
Watch for redis.memory.fragmentation_ratio consistently above 1.5 combined with increasing redis.keys.evicted and declining redis.keyspace.hits / (redis.keyspace.hits + redis.keyspace.misses) cache hit rate. Redis memory.used may appear below maxmemory while physical RSS is at limit.
Trigger activedefrag if available (Redis 4.0+) or schedule controlled restarts during low-traffic windows. Consider using jemalloc allocator tuning. Evaluate workload patterns causing fragmentation (frequent updates to varying-size values). Set alerts when fragmentation ratio exceeds 1.5 for 15+ minutes.