Control loops & scaling
Autoscaler Arena
Hand-draw a load spike, then try to keep the cluster from oscillating.
How to read this lab
A Kubernetes-style autoscaler watches load and decides how many replicas to run. Disable its stabilization window and a normal, oscillating load pattern makes it flap — scaling up and down over and over. Turn the window back on and the exact same load produces a stable, non-flapping replica count.
Controls
- Load curve (drag to draw)
- Sets the requests-per-second arriving over a simulated multi-hour window — the raw load driving the whole system.
- Diurnal / Flash crowd / Sawtooth
- One-tap presets for a smooth day/night cycle, a sudden traffic spike, or a repeating ramp — no drawing required.
- Stabilization window enabled
- When on, a scale-down decision only applies if load has stayed low for the FULL lookback window (real HPA behavior) — a brief dip can't shrink the fleet. When off, every recommendation applies immediately.
What to watch for
- With the stabilization window ON, watch replica count settle into a smooth curve even as load oscillates.
- Turn it OFF and replay the same load — Thrash count climbs and the replica line saws up and down.
- After a sharp load spike, watch the pod fleet: new replicas show amber (still warming up) before they count toward real capacity — latency can breach the SLO even after scale-up has already been decided.
Why it happens
The autoscaler only takes action outside a tolerance band around its target, and — critically — a scale-down decision is the MAXIMUM recommendation seen over the last several minutes, not the latest one. That means a brief dip in load can't shrink the fleet; only sustained low load for the whole window can. Strip that window away and every small dip triggers an immediate scale-down, which then has to scale back up moments later when load returns — that back-and-forth is flapping, and it's a direct, mechanical consequence of removing the lookback, not a bug.
Try this first — Click the Sawtooth preset with Stabilization window enabled, then disable it and replay — watch Thrash count jump from 0 to several.
Warming up…
The simulation just (re)started — give it a moment for the first HPA sync tick before reading the numbers below.
- Applied replicas
- Desired (ideal) replicas
- Latency
- SLO threshold
- Warmed-up pod
- Pod warming up
Scale-down stabilization
How it works
HPA only evaluates on a fixed sync tick (every 15s), ignores deviations inside a +-10% tolerance band, and scales down using the highest recent recommendation instead of the newest one. Newly created pods also ramp capacity in over a warm-up window, so a spike can outrun even a correct scale-up decision.
Thrash count
0
Replica-count direction reversals
SLO met
100%
Time under the latency threshold
Pod-minutes
0.0
Replica x minutes (cost proxy)