Cache Simulator
Can this cache absorb real demand without hiding stale data or overwhelming the origin?
A cache is a traffic-shaping layer. Demand shape, useful capacity, eviction, expiration, and refill behavior decide which requests stay on the fast path and which become origin work.
Step 1
Model
Choose a workload, tune capacity, TTL, cache levels, and eviction policy, then inject a pressure scenario.
Step 2
Observe
Trace requests through cache and origin, compare load with the origin envelope, and inspect latency, duplicate fills, churn, and stale-response risk.
Step 3
Challenge
Establish a healthy baseline, challenge it with hot-key skew, a miss storm, eviction churn, a slow origin, or stale-content risk, then enable each protection separately.
Shape demand, trace the miss path, protect the origin
Every control changes one connected model. Start with useful cache coverage, then inject pressure and see whether misses become bounded work or an incident.
Healthy operating state
The cache contains this demand
Live request path
18K requests each second
Incoming demand
18K
requests / second
79.3% served in 1ms
3.7K/s required + 0/s duplicate
Cache
1GB across 1 level
Origin
120ms at 49% load
Pressure readout
What moved, and why
Useful working-set coverage
Cache capacity ÷ active working set (1GB ÷ 1.8GB)
57%
Eviction churn
Estimated displaced keys as a share of incoming requests
621/s
Stale-response exposure
Hit rate × write rate × TTL exposure; SWR lowers, but does not remove, risk
0.5%
Tail latency
Origin latency amplified by utilization and duplicate fills
186ms
Calculation trace
- Cache hit rate
- 79.3% steady − scenario penalties = 79.3%
- Origin attempts
- 3.7K misses + 0 duplicate fills + 0 refreshes = 3.7K/s
- Average latency
- hit share × 1ms + miss share × 120ms = 26ms
- Cost avoided
- hit savings − cache tiers − refill amplification = 65%
Assumptions are comparative, not vendor benchmarks. Validate with an access trace, object-size distribution, and an origin load test.
Scenario Steady traffic. Hit rate 79.3%. Average latency 26ms. Origin utilization 49%. Status healthy.