Memory Capacity Planning for Growing Workload
warningCapacity Planning
Proactively monitoring memory usage trends to determine when to scale Redis before hitting maxmemory limits and triggering evictions or OOM conditions.
Prompt: “Our Redis memory usage has grown from 60% to 82% of maxmemory over the past month and the trend is continuing. I want to understand if this growth rate means we'll hit our limit soon and start evicting keys. Should I scale up the instance now or can I wait? What's the safe memory threshold to stay under?”
Agent Playbook
When an agent encounters this scenario, Schema provides these diagnostic steps automatically.
When planning Redis memory capacity, start by checking whether evictions have already begun, then assess memory fragmentation impact which can accelerate hitting limits. Calculate your runway to the critical 90% threshold based on growth trends, and review historical peak usage patterns to identify recurring spikes. The goal is to scale proactively before sustained operation above 85-90% of maxmemory where eviction pressure becomes severe.
1Check if key evictions have already started
First thing I check is `redis.keys.evicted` to see if Redis is already evicting keys to stay within limits. Even a low but increasing eviction rate is a red flag. The `high-eviction-rate-indicates-memory-pressure` insight shows that when `redis.memory.used` exceeds 90% of `redis.memory.maxmemory`, evictions accelerate rapidly and cache hit rates decline. If you're seeing evictions at 82% usage, you likely have fragmentation issues or maxmemory set too aggressively.
2Assess memory fragmentation impact on actual usage
Check `redis.memory.fragmentation_ratio` — if it's above 1.5, your actual memory footprint is significantly larger than logical used memory, and you could hit physical limits before `redis.memory.used` reaches `redis.memory.maxmemory`. The `memory-fragmentation-amplifies-cache-eviction-pressure` insight explains how high fragmentation triggers premature evictions. At 82% logical usage with a 1.5x fragmentation ratio, you're actually consuming closer to 123% of reported usage, putting you at immediate risk.
3Calculate your runway to the 90% critical threshold
You've grown from 60% to 82% in a month — that's 22 percentage points, or roughly 0.73% per day. At this rate you'll hit 90% in about 11 days and 100% in 25 days, though growth often accelerates as workloads scale. Track daily `redis.memory.used` trends to detect acceleration. In my experience, you want to scale before hitting 85-90% of `redis.memory.maxmemory` to maintain headroom for traffic spikes and avoid the eviction pressure zone.
4Review historical peak memory patterns for spike risk
Compare `redis.memory.peak` to current `redis.memory.used`. If peak is significantly higher (>30% per the `peak-memory-exceeded-indicates-historical-capacity-issues` insight), you've experienced memory spikes that could recur. Look for daily or weekly patterns in peak usage — if these happen during batch jobs or traffic spikes, your current 82% could spike to 100%+ during these events, triggering immediate evictions even if average usage looks manageable.
5Verify eviction policy alignment with workload expectations
Review your maxmemory-policy configuration to ensure it matches your use case. With noeviction, you'll start getting write errors at maxmemory. With allkeys-lru, Redis evicts any key to make room. The `high-eviction-rate-indicates-memory-pressure` insight notes that mismatched policies cause hot data evictions and cache miss storms. Also check if keys have appropriate TTLs — unnecessarily long-lived keys consume memory that could be reclaimed naturally without scaling.
Technologies
Related Insights
Peak Memory Exceeded Indicates Historical Capacity Issues
info
When redis.memory.peak significantly exceeds redis.memory.used, the system has experienced memory pressure in the past that may recur. This indicates need for capacity planning or workload pattern investigation.
High Eviction Rate Indicates Memory Pressure
warning
When redis.keys.evicted rate increases significantly, Redis is evicting keys to stay within maxmemory limits, potentially causing cache miss storms and degraded application performance as hot data is prematurely evicted.
Memory Fragmentation Amplifies Cache Eviction Pressure
warning
High 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.
Relevant Metrics
Monitoring Interfaces
Redis Native Metrics