Skip to main contentSkip to user menuSkip to navigation
Interactive design lab

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.

Cache pressure lab

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.

Loop 2 · Inject operating pressure

Healthy operating state

The cache contains this demand

79.3% hit rate26ms average49% origin load0.5% stale risk

Live request path

18K requests each second

Cache hitRequired missDuplicate fill

Incoming demand

18K

requests / second

Fast path · cache hit14K/s

79.3% served in 1ms

Slow path · origin work3.7K/s

3.7K/s required + 0/s duplicate

Cache

1GB across 1 level

Origin

120ms at 49% load

Origin serving envelope3.7K / 7.6K req/s
070% guardrail100% capacity

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.

No quiz questions available
Could not load questions file
Spotted an issue or have a better explanation? This page is open source.Edit on GitHub·Suggest an improvement