One pod, many calls
Jarvis is our real-time voice agent. Every call runs through the same chain: the person speaks, Jarvis works out when they have finished, turns their words into text, passes the text to a language model, turns the reply back into speech and plays it to them. Like any normal web service, one Jarvis pod handled several calls at once.
Inside one jarvis pod, a call runs top to bottom: the user’s audio arrives over WebRTC at the WebRTC native client; PCM goes to a custom VAD; speech frames go to STT, which streams them out to a speech-to-text vendor; the transcript goes to the LLM, with Stark, the orchestrator; the text goes to TTS, which takes the reply in from a text-to-speech vendor; and the PCM goes back out through the WebRTC native client, over WebRTC to the user.
That worked until we tried to scale. Pods began to crash, out of memory, while serving only a handful of calls and holding hundreds of threads open. Our earlier fix to how calls were routed had nothing to do with it. The problem was the shape of the system.
Three problems, one cause
Looking closely, we found three separate problems, and every one of them grew with the same thing: how many calls a single pod was serving.
- Timing slipped under load. Jarvis decides a person has stopped talking after a short stretch of silence. When a busy pod fell behind, their audio arrived late, and late audio looks like silence. Jarvis answered half a sentence, then the rest, and the caller heard two replies.
- Calls competed for the same budget. Turning speech into text and text back into speech isn’t heavy on its own, but it comes in bursts. Put several calls on one pod and their bursts collide.
- Memory leaked. The software that connects each call starts about ten threads of its own, and only one step at the end of a call frees them. Under load that step was sometimes skipped, so each call left something behind, while our own metrics said everything was clean.
We fixed the leak. The bigger lesson was the pattern.
What if a pod only ever served one call? Like a game server: one match, then it exits.
Borrowing from game servers
Then nothing can leak across calls, because there is no across calls. A call never competes with another, because there are no neighbours. The problem collapses from making a crowded process behave to handing out fresh ones fast enough, and the game industry solved that years ago.
Its answer is Agones, a Kubernetes controller from Google and Ubisoft that keeps a pool of game servers ready, hands exactly one to each match and makes sure nobody shuts it down mid-game. Swap “match” for “call” and it fits, down to the failure modes.
How a call gets its pod
- Scheduledboot
- Readywarm
- Allocatedin a call
- Shutdowndeleted, backfilled
When a call comes in, Stark, our orchestrator, asks Agones for a ready pod and talks to it directly. Two rules make this safe. A pod can be handed out only once, so two callers can never share one. And only the pod itself can leave a call: nothing reclaims it to scale down or roll out an update. A scale-down can never hang up on someone.
Keeping pods warm
The first question everyone asks is how many idle pods to keep. Not one for every call: the pool already grows as calls arrive. The spare pods only have to cover the calls that come in while a replacement is still starting up, which makes start-up time, not traffic, what drives the cost. So we cut it, loading everything a pod needs before it reports ready rather than on its first call.
In production, picking a pod takes tens of milliseconds. The caller doesn’t know their pod didn’t exist a moment ago.
Never cutting a call short
The machines under the pods come and go with demand, run by Karpenter, and four settings decide whether that can ever drop a live call. A machine is removed only when it is empty, because moving a pod means ending a conversation. New calls go to the fullest machine first, so the others can empty out. Pods in a call are marked as off limits. And there are no spot machines, which give two minutes of warning before they disappear, while a call lasts longer than that.
When a pod is claimed but never used
Because only a pod can release itself, one that never does stays claimed for good. That happens more than you’d guess. Here is one week of production:
- Weekly calls started
- 9.84K
- Weekly calls joined
- 9.30K
Some people never join once the call is set up, and an idle timeout tidies those away. Others join and hang up before the call has finished starting. To catch both, we compare the number of claimed pods with the number of live calls: a gap that persists is a leaked pod.
What changed
Same production environment, shared pods before, one-call pods after:
| Before | After | |
|---|---|---|
| Threads per pod | hundreds | dozens |
| Heap per pod | at the limit, OOMKilled | bounded, no OOMKills since cutover |
| CPU | spikes colliding across calls | one call’s spikes, Guaranteed QoS, no neighbours |
| Pod affinity | Istio hash ring, reshuffles on scale | the address Agones returned |
| Allocation latency | n/a, Service round-robin | tens of ms at p95 |
| Capacity model | “how many calls fit in a pod?” | pods per node, linear |
| Risk to live calls from scaling | HPA + default scheduling | WhenEmpty + Packed + do-not-disrupt + on-demand |
The new design didn’t fix the leak; the earlier fix did. What it did was make that whole kind of bug irrelevant. A process that serves one call and then disappears can’t accumulate anything.
For any real-time work where each session belongs to one person, voice agents, video rooms, browser sessions, the lesson travels: hand out one fresh process per session, and never end it mid-session. And watching a fleet replace a pod in the time it takes to say hello is a pretty good feeling.



