Latency, throughput and bandwidth
Three numbers that get confused constantly. Percentiles are the only honest latency.
What you will be able to do
- Define latency, throughput and bandwidth without mixing them up
- Explain why an average latency figure hides the problem
- Describe the latency-throughput trade-off and when to take it
- Read a p99 against a user-facing budget
| Term | Question it answers | Example |
|---|---|---|
| Latency | How long does one request take? | p99 of 180 ms for a feed read |
| Throughput | How many requests finish per second? | 5,000 reads per second |
| Bandwidth | How many bytes move per second? | 2 GB/s outbound at peak |
| Concurrency | How many are in flight at once? | 1,000 open connections |
Why percentiles, not averages
Averages blend the fast majority with the slow minority and produce a number no user experiences. If 99 requests take 10 ms and one takes 2 seconds, the average is about 30 ms — which describes nobody. The user who hit the slow request waited two seconds, and they are the user who leaves.
Say p50, p95 and p99 instead. p50 tells you the typical experience, p99 tells you what the unlucky users get, and the gap between them tells you whether the system has a tail problem: garbage collection pauses, lock contention, cold caches, or one hot shard.
The trade-off you are allowed to make
Batching raises throughput by amortising fixed cost per item, and it costs latency because the first item waits for the batch to fill. Both directions are legitimate; the mistake is not choosing.
Worth remembering
- Latency is one request's duration; throughput is how many complete per second; bandwidth is bytes per second.
- Averages lie. A p50 of 20 ms with a p99 of 2 s is a system that is slow for one user in a hundred, all day.
- Batching and queueing raise throughput and hurt latency. Choose deliberately per workload.
- Little's Law: concurrency equals throughput times latency. It predicts queue growth before you see it.