Systems on Glass ยท Episode 1 ยท System design

Latency vs Throughput

or: how a million requests a second stay fast

About three minutes, generated by Claude as part of my AI-automation side project. The narration is an AI clone of my own voice.

Made with AI, for fun

Systems on Glass is an AI-automation side project of mine. Every episode is generated by Claude (Anthropic's AI, working through Claude Code in my own video studio): the script, the animations and 3D scenes, the edit, and the narration in an AI clone of my voice. I choose the topics, bring the stories from my own work, and review each episode before it goes up. Not affiliated with Anthropic.

At Amazon Ads, the ad-relevance API I worked on answered over a million requests a second, each inside twenty milliseconds. That sounds like one number about speed. It's two different problems, and they have two different fixes.

The short version

As in my post about this API, every number about that system (a million a second, 20 ms, 17 calls, 3ร— for Prime Day) is illustrative: deliberately rounded, inflated or deflated, not the real figures. The maths holds for any numbers.

in flight = 1,000,000 / s ร— 0.02 s = 20,000 requests
slow at least once = 1 โˆ’ 0.9917 โ‰ˆ 16% โ‰ˆ 1 in 6
time per request โ‰ˆ work รท (1 โˆ’ busy): 50% โ†’ 2ร—, 90% โ†’ 10ร—

Before Prime Day, a traffic team forecast the peak a month ahead, and I owned scaling our systems up to about three times normal, with autoscaling on top for surprises and the capacity warmed early so nothing started cold. Spare capacity is what kept latency flat.

Further reading

Next episode: What Is an Agent? Then Caching, and how seventeen calls got cheap. All episodes โ†’