← All lessons
0108

Batching & Serving

A GPU pass has a large fixed cost — loading the model's weights from memory — whether it processes one request or thirty-two. Serving one conversation at a time leaves the hardware mostly idle. Batching stacks many requests into a single pass so the fixed cost is paid once and shared: throughput multiplies, at the price of a small wait while the batch fills. Production servers go further with continuous batching, slotting new requests into the batch the moment another finishes, instead of waiting for a whole round.

Slide the batch size. Watch queue time (grey) trade against total time, GPU utilisation climb, and throughput jump as more requests share each pass.

Batch size4 req / passGPU busy: 44%
req 1req 2req 3req 4req 5req 6req 7req 8grey = waiting in queue · blue = in a GPU passall 8 served in 36ms (2 passes) · throughput 222 req/sone at a time would take 96ms the fixed cost of a pass is paid once per batch, not per request

Check yourself

Batch size 8 serves everyone fastest here — so why do latency-sensitive services still cap their batch size?

Go deeper (free): vLLM — Easy, fast LLM serving (blog)

Next: Temperature