Skip to content
SD-26 · CONCURRENT STREAM LIMITS · INTERACTIVE

Break it.
Then fix it.

Turn up the number of people watching, watch what breaks, and add the parts a real stream-limit service needs. Every switch is a decision you would defend in an interview.

CHALLENGEHandle 40M concurrent streams with no errors, start checks under 50 ms p99, no double starts and no slots stuck after a crash.
StatusDOWNAt 10M streams
Start check p99477 msTarget under 50 ms
Errors99%Double starts possible
Monthly cost$19,2201.0M heartbeats/s
PlayersLIVE
10M streams · beat every 10 s
1.0M beats + 10K starts/s
Load balancerOK
Autoscales the service
spreading 1.0M req/s
Service × 120RACE
At the autoscale limit
1.0M / 1.2M req/s
SQL databaseDOWN
Sessions table
1.0M ops/s
Every heartbeat is a SQL write. 1.0M updates/s to a sessions table that takes 10,000. The live count is small and short-lived: keep a sorted set of leases per account in an in-memory store.
94%Requests that are heartbeats667,000 a second at 40M streams; starts are only 40,000.
3 minLease length3 heartbeats of 60 s, so a crashed TV frees its slot on its own.
1 shardPer accountAll of an account’s leases on one shard make the check atomic without a lock.
OpenWhen the store failsAllow the stream rather than block paying members.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.