Latency, Throughput & Bandwidth

Three words people mix up constantly — and getting them straight changes how you design.

Latency, throughput & bandwidth in 30 seconds

  • Latency: how long one request takes — the thing users actually feel.
  • Throughput: how many requests per second the system handles.
  • Bandwidth: how much data the pipe moves per second — they're independent knobs.
  • Measure the tail: report p95/p99, not the average — averages hide the slow 1% that a fan-out page always hits.
  • The latency ladder: memory is ~a million times faster than a cross-region hop — that gap is why caches and CDNs exist.
  • The trade-off: batching raises throughput but adds per-request latency — pick based on what the constraint really is.

A highway at rush hour

Think of a highway. Latency is how long your car takes to get from home to work. Throughput is how many cars the highway moves past a point each minute. Bandwidth is how many lanes it has. These are clearly different things: adding lanes (bandwidth) lets more cars through (throughput), but your personal drive (latency) might not get one second shorter if the on-ramp is the real holdup.

People blur these three words together, and it leads to fixing the wrong problem — widening the highway when the actual complaint is that every single trip is slow. Keep the highway in mind and the distinctions stay sharp: your trip, the flow past a point, the number of lanes.

The problem it solves: knowing which knob to turn

When a system 'feels slow' or 'can't keep up', those are two completely different complaints with completely different fixes. If you can't name precisely what's wrong, you'll tune the wrong thing — add servers when users are complaining about per-request delay, or chase milliseconds when the real issue is raw volume. These three words are the vocabulary that turns 'it's slow' into a specific, fixable diagnosis.

Three different questions

These terms get used loosely, but they answer distinct questions. Latency: how long does one request take? Throughput: how many requests can the system handle per second? Bandwidth: how much data can the pipe carry per second? A system can have great throughput and still feel slow (high latency), or low latency and still buckle under volume (low throughput). You have to reason about them separately.

Latency: the one users feel

Latency is the delay between asking and getting an answer. Users feel it directly — a 2-second page is a slow page no matter how many other users the system serves. The trap is measuring it with averages. A good average can hide a terrible tail: if your p99 (the slowest 1% of requests) is 3 seconds, one in a hundred requests is painful, and a page that makes 100 calls will almost always hit one. Design and measure for p95/p99, not the mean.

Why the average lies — meet the tail

Here's the gap a single average can't fill. Say 99 requests take 50ms and one takes 3 seconds. The average is about 80ms — which looks great and is a lie. That one slow request is a real user staring at a frozen screen, and on a page that fans out into many calls, you reliably hit the slow one.

This is why we quote percentiles. p50 (the median) is the middle request — half are faster, half slower. p99 is the slowest 1% — the bad-but-not-rarest case. The gap between p50 and p99 is the story averages hide, and it's exactly the experience your unluckiest users get every time.

Most requests are fast (p50), but the slow tail (p99) is what fan-out pages actually feel.
Why the tail bites: a page that fans out into many calls (python)
# Suppose 1 in 100 backend calls is slow (p99 is bad).
p_slow_per_call = 0.01

# A simple page makes 1 call: chance it feels slow = 1%.
# A dashboard fans out to 100 backend calls to build ONE page:
calls = 100
p_page_feels_slow = 1 - (1 - p_slow_per_call) ** calls

print(round(p_page_feels_slow, 2))   # => 0.63
# ~63% of page loads hit at least one slow call!
# The average call was fine; the PAGE is slow most of the time.
# This is why we design against p99, not the average.
Latencies span orders of magnitude — the ladder guides every trade-off.

The latency ladder shapes your design

The gaps here are enormous. Reading from memory is roughly a million times faster than a cross-region network round trip. That single fact is why caching exists, why CDNs put content near users, and why chatty designs that make many sequential remote calls feel sluggish. When you know the ladder, a lot of design decisions stop being guesswork.

A concrete way to feel it: if a memory read were one second, an SSD read would be minutes, a trip across the data center would be about an hour, and a round trip to another continent would be weeks. Those aren't the real units — but the ratios are roughly right, and they explain instantly why you'd move heaven and earth to serve a request from memory instead of a remote call.

Throughput and bandwidth

TermMeasuresTypical unitImproved by
LatencyTime for one requestms (p50/p95/p99)Caching, proximity (CDN), fewer round trips
ThroughputRequests handled per secondreq/s, QPSHorizontal scaling, async processing, batching
BandwidthData moved per secondMbps, GbpsCompression, smaller payloads, CDNs
Batching: one round trip for many items raises throughput, adds latency (javascript)
const queue = [];

function enqueue(item) {
  queue.push(item);                 // each item waits for the batch to fill
  if (queue.length >= 100) flush(); // batch is full -> send now
}

// Flush every 10ms even if not full, so latency has a ceiling
setInterval(flush, 10);

function flush() {
  if (queue.length === 0) return;
  const batch = queue.splice(0, queue.length);
  writeAll(batch);                  // 1 round trip instead of 100
}

Bandwidth: the one that bites with big payloads

Bandwidth is the forgotten one because, for small JSON responses, the pipe is never the limit. It becomes the star the moment payloads get big: images, video, file downloads, bulk exports. A phone on a weak mobile connection has a narrow pipe, so a bloated 5MB page feels slow no matter how fast your servers answer — the bytes simply can't arrive any quicker.

The fixes are about moving fewer bytes: compress responses, serve appropriately-sized images, paginate instead of dumping everything at once, and push heavy static content onto a CDN near the user. Notice that a CDN helps both latency (shorter trip) and bandwidth (the fat transfer happens over a short, fast last mile) — which is why it shows up as the answer to so many performance problems.

Cutting latency: the practical moves

Once you can read the ladder, lowering latency stops being mysterious and becomes a short checklist. Nearly every real latency win is one of these moves — each one is really about climbing down the ladder to a faster rung or making fewer trips:

MoveWhat it doesWhen it helps most
CacheServe from memory instead of disk or a remote call.Repeated reads of the same hot data.
CDN / move closerPut data near the user, cutting the network round trip.Static content, global users.
Fewer round tripsBatch calls or denormalize so one request suffices.Chatty pages that fan out into many sequential calls.
Do work ahead of timePrecompute results offline so reads are instant.Expensive results that don't change per-request.
ParallelizeFire independent calls at once instead of in sequence.A page that needs several independent pieces.
Sequential vs parallel calls — same work, very different latency (javascript)
// SEQUENTIAL: each call waits for the one before -> latencies ADD UP.
async function slow(id) {
  const user    = await getUser(id);      // 50ms
  const orders  = await getOrders(id);    // 50ms
  const credits = await getCredits(id);   // 50ms
  return { user, orders, credits };        // total ~150ms
}

// PARALLEL: independent calls fire together -> latency is the SLOWEST one.
async function fast(id) {
  const [user, orders, credits] = await Promise.all([
    getUser(id), getOrders(id), getCredits(id),   // all at once
  ]);
  return { user, orders, credits };          // total ~50ms, not 150ms
}

Little's Law, informally

A handy intuition: the number of requests in flight equals throughput multiplied by latency. If each request takes 100ms and you want 1,000 requests per second, you'll have about 100 in progress at any moment — which tells you how much concurrency, how many connections, and how big a thread or worker pool you need. Lower the latency and you need less of everything to hit the same throughput.

Little's Law: concurrency = throughput x latency (javascript)
// How many requests are in flight at once?
const throughput = 1000;   // requests per second we want
const latency = 0.1;       // seconds per request (100ms)

const inFlight = throughput * latency;  // => 100 concurrent requests
// So size the worker/connection pool around ~100.

// Halve the latency and you need half the concurrency for the same rate:
const faster = throughput * 0.05;       // => 50 concurrent requests

This is why cutting latency is a double win: faster requests not only feel better, they free up concurrency, so the same pool of servers can serve a higher rate. Latency and throughput look independent, but Little's Law ties them together through the resources in the middle.

These three numbers are the vocabulary of performance — nearly every optimization on the portal is really a move to lower latency, raise throughput, or save bandwidth.

Why it matters

  • They're the non-functional targets that drive the design, so getting the words straight stops you optimizing the wrong thing.
  • Measuring at p95/p99 is what separates a system that feels fast from one that's fast only on average.
  • The latency ladder turns a lot of design decisions — cache, CDN, fewer round trips — from guesswork into arithmetic.

If ignored

  • You confuse the knobs, scale for throughput when users are complaining about per-request latency, and fix nothing.
  • You report a healthy average while the p99 tail quietly ruins the experience for fan-out pages.
  • You add batching for throughput and accidentally make every single request slower.

Where it fits

  • Sits in the measurement and SLO layer — the targets you set before choosing components.
  • Shows up on the read path (caching, CDNs, proximity) and the write path (async, batching, queues) alike.
  • Feeds the estimation step of the interview, where QPS and latency budgets decide the architecture.

Related topics

  • Caching: the biggest single latency win — keep hot data close
  • CDN: cuts latency by serving content from near the user
  • Message queues: smooths throughput spikes at the cost of per-item latency
  • Scalability: scaling out is how you raise throughput once one box is maxed

Interview lens

Questions it unlocks

  • What's the difference between latency and throughput?
  • Why do you measure p99 instead of the average?
  • How would you cut the latency of a slow endpoint?

60-second answer

Latency is per-request delay, throughput is requests-per-second, bandwidth is data-per-second — they're independent and I reason about each. I measure latency at p95/p99 because averages hide a painful tail, especially for pages that fan out into many calls. To cut latency I reduce round trips, cache, and move data closer to users via a CDN; to raise throughput I scale out, go async, or batch — while watching that batching doesn't hurt the latency users actually feel.

Common traps

  • Treating latency and throughput as the same knob.
  • Reporting average latency and ignoring the p99 tail.
  • Batching for throughput without accounting for the added per-request delay.

Search topics

↑↓ to move · Enter to open · Esc to close