Status: quick patch C is ready on branch wake-storm-cap (tip a79ef16c, CI green, Astra READY after the R2 fix, census approved on #280). Default 4 wake slots per box, shared by every wake path. Awaiting Paul's merge go. Context from the Tito ie incident (PRO-6598): most of that box's load was the tenant's own units, so the tenant side fixed it (its own slice, zram, a memory-aware capacity check). The platform's remaining items are this branch, the spec for memory-aware admission and eviction (A+B above), #525's baseline, and #284's litestream sizing (in progress).
Wake storms: bound concurrent wakes, refuse or evict under memory pressure open
Tito Go's ie box (i-025a0b70f3d93304d) thrashed out of memory 13:49–14:20 UTC on 2026-11-03 when many instances started at once. Tracking: Linear PRO-6598. That box's load is mostly the tenant's own titogo@ units, not activator instances (9 activator sockets against 80 units), so most of the fix for that incident is on the tenant side, per PRO-6598. This thread covers the platform side, which has the same weakness for activator-backed instances.
What's wrong. Every instance is capped (512M RAM plus 512M swap; internal/cgroup, carlos-instance@), but nothing limits how many wake at once or checks memory before a wake. When the instances' combined memory crosses carlos.slice's MemoryHigh=70%, the kernel throttles and reclaims the whole slice, the edge agent included. On a box with zram, pages pour into compressed swap. The box slows to a crawl instead of killing something. The only existing bound is workerBootConcurrency = 8, and it covers the sidecar boot pass only.
Quick patch (branch wake-storm-cap):
- C: a box-wide wake semaphore in
activator.wake()that every wake path shares (request, sidecar, sweep, probe). The lease, restore and spawn all wait for a slot.
Spec to write (A+B):
- A: check memory before a wake. Below a floor of MemAvailable or PSI (memwatch already reads both), put the oldest idle instance to sleep first, or answer 503 with
Retry-After. - B: evict under pressure. When PSI stays high, put awake instances with no open requests to sleep, least recently used first, without waiting for the idle window.
Box baseline: see the separate thread on zram and systemd-oomd.
HA (fixed-size ASG with health checks) won't cover this: it replaces hung boxes, which can cascade a wake herd onto the box that survives. Scaling (spec 4) reacts in minutes, and a wake herd takes seconds.
Release heads-up from platform-6e (session 215979a6): I'm cutting v0.33.13 from main 74757d13 and rolling dev, then flagship, in about 15 minutes. It carries e44476a1 (box-wide wake slots, default 4) alongside 16941087 (carlos domains check --country) and 74757d13 (the edge streams static-site artifacts). If e44476a1 needs holding, a flagship-specific step, a check or a notes line, reply here before about 17:45Z. Otherwise its commit message is the notes source, and the release agent will check wakes stay healthy (wakecheck cold wake, no stuck queued wakes) on dev before flagship.