Routing 12 million runs a day
without a queue.
Why we threw out our job queue, what replaced it, and the one graph we watch every morning.

Owen Pratt
Staff Engineer
11 min read

In short
For our first two years every run went through a job queue. It worked, until a slow model held a few thousand runs hostage and the queue backed up behind them. This is what we built instead.
Why the queue had to go
A queue is fair: first in, first out. Our traffic is not. A short chat reply and a 40-page contract review should not wait in the same line, and a slow provider should never hold up a fast one.
What replaced it
Each run now gets a lane based on its route and its expected length. Lanes have their own limits, and the router moves a run to the next best model after 20 seconds instead of waiting.
Short runs never wait behind long ones.
One slow model slows one lane, not the whole system.
Retries happen where the run is, not at the back of a line.
The graph we watch
Every morning we look at one chart: the 99th-percentile wait per lane. If one line climbs, we know which model or customer to look at before anyone opens a ticket.
Found this useful?

Written by
Owen Pratt
Owen looks after the router and the trace store. He likes boring infrastructure, graphs that go down and on-call weeks where nothing happens.
Keep reading
