esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

Latency vs Throughput Trade-Off

Why a server that serves more users at once can make each user wait longer, and how to pick a setting for chat or for batch work, explained simply for your AI interview.

In short

Latency is how long one user waits. Throughput is how much work the whole server finishes in a set time. Sharing more requests in one batch raises throughput but usually makes each user wait longer, so teams pick a setting for live chat or for batch jobs.

10 min readIntermediateCommon · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Latency is how long one user waits. Throughput is how much work the whole server gets done. They pull against each other: when the server groups more requests into each run, it finishes more in total, but each user waits longer. So for a live chat I keep latency low, and for a big overnight job I push throughput up and accept the wait, using the batch option the provider offers.

What are latency and throughput, in plain words?

Both are measures of speed, but they look at different things. Latency is about one person: how long they wait. Throughput is about the whole queue: how much work gets finished in a set time.

A hospital lab is a good picture. A technician who runs one blood test at a time gets each result fast. A machine that runs 200 samples in one cycle finishes far more tests per hour, but every sample waits for the cycle to end. An AI server works the same way, and the shared run is where the trade-off comes from. In an AI server, a chat reply and a nightly job share the same batch run.

Key words

Latency
How long one request takes, from sending it to receiving the complete answer.
Time to first token (TTFT)
How long until the first word appears. This is the wait a chat user feels most.
Throughput
Total tokens the whole server makes per second, across all its users.
Batch
Several requests that the server runs together in one step.
Token
A small piece of text, about a word or part of one, that the model reads or writes one at a time.

Why do they pull against each other?

A batch is shared. When the server adds more requests to it, the server makes more tokens in total each second. But every step now carries more work, so each request gets its next token a little later.

One server, two batch settings

Requests arrive

from chat users and batch jobs

Small batch

Few requests per step

each step is quick

Large batch

Many requests per step

each step takes longer

Shorter waits per user

more tokens a second each

Longer waits per user

fewer tokens a second each

More total output

the server finishes more work

  1. 1Some requests land on the small batch, which runs a few at a time.
  2. 2Other requests join the large batch, which runs many at once.
  3. 3Each step is quick, so every user sees more tokens a second.
  4. 4Each step is slower, so every user sees fewer tokens a second.
  5. 5The same work adds up across users: total output rises.
One server, two settings. A small batch keeps each user's wait short. A large batch makes more tokens in total, and each user waits longer. The chart shows the choice only, with no measured numbers.

A queue adds a second effect. Once more requests arrive than the batch can hold, the extra ones wait for a free slot, and their first words come later still. NVIDIA's benchmarking guide says throughput saturates around the maximum batch size.

  • “Therefore, the throughput of the system generally saturates around the maximum batch size while the latency will continue to steadily increase.”

    NVIDIA, LLM inference benchmarking

  • “High throughput serving of large language models (LLMs) requires batching sufficiently many requests at a time.”

    Kwon et al., PagedAttention paper (2023)

The paper explains why servers batch at all: high throughput needs many requests in one run. NVIDIA's guide shows the cost: past a point, more load adds almost no throughput and only adds delay.

What does batching do to a server's numbers?

Here is a made-up server with invented numbers. Each step costs 40 ms, plus 0.5 ms for every request in the batch. The script prints what one user sees, and what the whole server makes.

Python
# A made-up GPU server. Each step gives one new token to every request in the batch.
# Assumed numbers (made up): a step takes 40 ms, plus 0.5 ms for each request in it.
BASE_MS = 40.0
PER_REQUEST_MS = 0.5

def step_ms(batch):
    return BASE_MS + PER_REQUEST_MS * batch

print("batch  per-user tok/s  total tok/s")
for batch in (1, 8, 32, 64):
    per_user = 1000 / step_ms(batch)   # tokens one user sees each second
    total = per_user * batch           # tokens the whole server makes each second
    print(f"{batch:>5}  {per_user:>15.1f}  {total:>11.1f}")

Output

batch  per-user tok/s  total tok/s
    1             24.7         24.7
    8             22.7        181.8
   32             17.9        571.4
   64             13.9        888.9
  1. 1

    Read the top row

    One user on its own gets 24.7 tokens a second, and the server makes 24.7 in total.

  2. 2

    Read the bottom row

    With 64 users, each one drops to 13.9 tokens a second, but the server makes 888.9. That is about 36 times the total.

  3. 3

    Ask who is waiting

    A chat user sits near the top rows. A batch job can sit near the bottom, because nobody is typing.

Real numbers depend on your model and hardware, so you measure the base cost and the per-request cost yourself. The shape of the trade-off is what carries over.

How do you choose: live chat or a batch job?

Decide by who is waiting. If a person is watching the screen, optimise for latency. If nobody is waiting, optimise for cost and total work. OpenAI's and Anthropic's batch options are built for the second case.

Chat and batch jobs take different paths

Chat reply

a person is watching

Nightly tagging job

200,000 made-up notes, nobody waiting

Live endpoint

answers as it goes

Batch queue

runs in groups, half the price

Reply in seconds

the person keeps working

Results when batch ends

up to 24 hours, often sooner

  1. 1The question goes straight to the live path.
  2. 2The job is queued with the other batch work.
  3. 3The answer streams back in seconds.
  4. 4Results arrive when the whole batch finishes.
Two jobs, two paths. The chat reply goes to a live endpoint and comes back in seconds. The nightly tagging goes to a batch queue, which trades the wait for a lower price. The volumes are made up.

OpenAI's Batch API sends groups of requests asynchronously. It gives a 50% cost discount and completes each batch within 24 hours, often sooner. The price is the wait, so a batch queue never suits someone typing a question.

  • “Batches might take up to 24 hours for processing, but many complete sooner.”

    Anthropic, batch processing

Tip

In an interview, state the rule first: if a person is waiting, you optimise latency; if nobody is, you batch for throughput and cost.

How would you run chat and a nightly job on one set of GPUs?

Give them separate lanes. A small-batch pool keeps chat latency steady, and the batch lane fills the spare capacity overnight. Mixing both in one queue lets a big job hold the batch and make chat replies wait.

  • Mixed in one queue

    Chat waits behind the job

    The big job fills the batch, so each chat user's first word arrives late.

  • Two lanes

    Each lane keeps its target

    Chat keeps a small batch and a latency target. The nightly job runs on spare capacity and has a deadline.

Measure both lanes separately: time to first token for chat, and whether the job finishes before the deadline.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: latency is one user's wait, throughput is total work per second.
  • Why they trade off: a shared batch adds total output but slows each step for every user.
  • Which numbers to watch: time to first token and its 95th percentile for chat, jobs finished by the deadline for batch.
  • The choice depends on who is waiting, and the answer names a setting you would change.
  • Batch options trade time for price, so they never suit live replies.

Common traps

  • Trap"Bigger batches are always faster."

    BetterBigger batches raise total output, but each user waits longer. Faster depends on which number you mean.

  • Trap"Throughput is just another word for speed."

    BetterThroughput counts the work of all users; latency counts one user's wait. A fast total can hide slow replies.

  • Trap"Put everything in one queue to save money."

    BetterOne queue makes chat wait behind the big job. Split the lanes so each keeps its own target.

Can you spot the slow tail?

Spot the problem

Your support dashboard looks healthy overall. Which line shows a user still waiting too long?

Quick check

A chat assistant feels slow, and the same server also runs a nightly job. What is the best first change?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q316TTFT vs tokens/sec vs total latency?12 min
  2. Q344What is a p95/p99 latency budget?11 min
  3. Q369How do you design for low latency?13 min
  4. Q340How do reasoning tokens affect cost and latency?11 min
  5. Q272How do you track latency and cost in evals?12 min

Learn it in depth

Last updated on 27 November 2026

Building a chat product that must answer fast and still run big jobs?

I design and build AI products and agents, the UI and the system behind it. Book a short call and tell me what your users wait for.