Debugging Live Audio at Scale: QUIC and MoQ relays
A few weeks ago, a back-of-envelope calculation told us that scaling Tula Spaces to 100,000 concurrent listeners would need roughly 100 small VPS boxes. That number was scary enough to derail a roadmap conversation — and, as it turned out, almost entirely wrong. This is the story of how we got from that panic number down to a real, measured, production-ready plan: five boxes, not a hundred, with every claim backed by a test rather than a guess. If you're building anything real-time at scale — live audio, video, multiplayer, anything running over QUIC — the failure modes we hit are probably waiting for you too. The panic number was built on an assumption, not a measurement The original math went something like: X% of a CPU core per listener, therefore Y cores needed, therefore Z boxes. It felt rigorous because it had numbers in it. But every number in that chain was inherited from an untuned, default configuration nobody had actually interrogated. The first rule we relearned the hard way: a scary capacity number is a hypothesis, not a fact, until you've tried to break it on purpose. Myth #1: "It's too much crypto for one core" Our relay runs one process per box, encrypting media for every connected listener over QUIC. At ~0.4% of a CPU core per listener at a modest bitrate, the instinctive explanation was cryptographic overhead — AES doesn't usually struggle at these data rates, so something had to be off. It wasn't crypto. It was packet count . Our encoder was emitting one CMAF fragment every 21 milliseconds — about 47 fragments a second, each one a separate send over the wire, per listener. That's a syscall and framing tax, not a cipher tax. Crypto didn't even show up in a profiler trace once we went looking. The instinct to reach for "batch the fragments" didn't work, though — that's the first place the story took a turn. Myth #2: Batching the container doesn't touch the wire We tried extending the CMAF fragment duration from 21ms to 200ms, expecting a straightfor