Latency vs throughput vs bandwidth: what is the difference?
How long one thing takes, versus how many things you finish per second.
By devskills editorial team · Last updated
What problem does the throughput argument solve?
Latency is how long a single request takes, measured in milliseconds. Throughput is how many requests you finish per second.
They sound like the same thing said two ways. They are not. Many engineering decisions improve one by making the other worse.
Confusing them means you improve the wrong number, then wonder why nobody is happier.
What the throughput argument costs you
When to reach for the throughput argument, and when not to
Use it when
- Deciding whether to batch. Batching raises throughput and usually adds latency to each item.
- Setting a target. "Fast" is not a target. "p99 under 200 ms at 5,000 requests a second" is.
- Reading a benchmark someone hands you. Check which of the two it measured.
Do not, when
- Do not chase throughput on a path where one person is waiting. They cannot feel your requests per second. They feel their one request.
How the throughput argument actually works
Adding lanes raises throughput and does nothing for your 30 minutes. Raising the speed limit cuts latency for everyone. They are separate levers.
Averages lie, and this is the part worth taking to heart. Nobody experiences your average latency. Say your average is 100 ms, but one request in a hundred takes four seconds, and a page makes twenty requests. Then about one page load in five (1 − 0.99²⁰ ≈ 18%) contains at least one slow request. So you quote percentiles instead. p50 is the middle. p99 is the request that is worse than 99% of the others. p99 is what your unhappiest users live in, and it is the number worth putting on a dashboard.
The trade in concrete terms. Batching a hundred database writes into one statement raises throughput a lot, because you pay the round trip once instead of a hundred times. It also raises latency for the first write in the batch, which now waits for the other ninety-nine to arrive. That is a good trade for analytics and a terrible one for a checkout button.
One more relationship worth knowing. As a system nears its throughput limit, latency does not get slowly worse. It stays flat, flat, flat, and then climbs almost straight up, because requests start queueing behind each other. That is why "we are at 85% capacity" is much closer to trouble than it sounds.
Latency vs throughput vs bandwidth. Bandwidth is the third word in this family, and it is the one people mix up with throughput. Bandwidth is the most a link or component could carry per second: a 1 Gbit/s network card, a disk rated at 500 MB/s. Throughput is what you actually get through, which is always at or below bandwidth, because of protocol overhead, contention and waiting. Latency is how long one item takes to get across. With the usual pipe picture: bandwidth is how wide the pipe is, latency is how long it is, and throughput is how much water is really flowing.
A useful formula: time to deliver something ≈ latency + size ÷ bandwidth. A 1 KB API response over a 100 Mbit/s link with 80 ms of round trip spends about 0.08 ms on the wire and 80 ms waiting, so more bandwidth changes nothing and only cutting round trips (or moving closer, as a CDN does) helps. A 1 GB file over the same link needs about 80 seconds of transfer, so there bandwidth is everything and the 80 ms barely registers. Small requests are latency-bound; big transfers are bandwidth-bound.
Where the two meet: the bandwidth-delay product. To keep a link full, the sender must have bandwidth × round-trip time of data in flight before the first acknowledgement returns. A 1 Gbit/s link with 100 ms of round trip holds about 12.5 MB in flight. If the TCP window is smaller than that, throughput stays well below bandwidth however fast the link is, which is why long-distance transfers between regions often disappoint until the window is large enough.
Latency vs response time. Many teams use the words interchangeably. When they are separated, latency is the time a request spends waiting (in queues, on the network) and response time is everything the client sees: waiting plus the time the server spends doing the work. Ask which one a dashboard shows before comparing numbers from two teams.
| Latency | Throughput | Bandwidth | |
|---|---|---|---|
| Measures | Time for one request or packet | Work actually completed per second | Maximum a link or component can carry per second |
| Unit | ms, µs; quote p50 and p99 | requests/s, messages/s, MB/s | Mbit/s, Gbit/s, MB/s |
| Motorway picture | How long your car takes | Cars completing the route per hour | Number of lanes |
| Improved by | Fewer round trips, caching, moving closer (CDN), less queueing | Parallelism, batching, removing the bottleneck | A faster link or device |
| Usually hurt by | Batching and queueing | Serial work, locks, a single slow dependency | Nothing in your code: it is a hardware or contract limit |
- Quoting averages. They hide the tail. Quote p50 and p99.
- Chasing throughput on a path where a person is waiting.
- Assuming latency gets slowly worse as you near capacity. It does not. It hits a wall.
The follow-up an interviewer will ask about the throughput argument
"Your p50 is 20 ms and your p99 is 3 seconds. What is going on?"
A gap that big is not the same work running slower. It is a different path, or a different shape of data. The usual causes, in order. Skewed data, where a few users have far more rows than a typical user, so their queries run differently. Queueing, where requests wait on something that has run out, like a connection pool. That shows up as two clusters of response times rather than a smooth curve. A dependency with its own bad tail that I call and wait for. Or garbage collection pauses. I would first check whether the response times form two clusters, because that points straight at queueing, and then trace one slow request end to end. There is also a structural cause worth naming. If a request fans out to many services and waits for all of them, it is as slow as the slowest reply, so each backend's rare slow tail shows up in a much larger share of my requests.
Latency vs throughput: common questions
What is the difference between latency, throughput and bandwidth?
Latency is how long one request takes. Throughput is how many requests (or bytes) you actually complete per second. Bandwidth is the most a link could carry per second. Throughput can never exceed bandwidth, and high bandwidth does not reduce latency.
Does high throughput mean low latency?
No. They are separate, and often traded against each other. Batching raises throughput by making each item wait for the batch, which raises its latency. A system near its throughput limit also has rising latency, because requests queue.
Why does more bandwidth not make my API faster?
Because small responses are latency-bound. A few kilobytes cross even a slow link in well under a millisecond; the time goes on round trips, TLS handshakes and server work. Cut round trips, reuse connections and cache closer to users instead.
What is the difference between latency and response time?
Often none in casual use. Strictly, latency is time spent waiting (network, queues) and response time is the whole time the client sees, including the server doing the work. Check which one a metric measures before comparing two numbers.
Your turn
You batch 100 writes into one database call. What happened to latency, and what happened to throughput?
Learn it from the source
- Google SRE Book — Monitoring Distributed Systems ↗The four golden signals: latency, traffic, errors, saturation. Where the distinction earns its keep.
- Brendan Gregg — The USE Method ↗Utilisation, saturation, errors. The method for finding which resource is actually the bottleneck.
Related concepts
All concepts on one page: system design cheat sheet