bigonotes
System DesignNetworking

Latency vs Throughput

The difference between latency and throughput, how to improve each, ballpark latency targets by system type, and SLA vs SLO vs SLI.

5 min readLast updated

Latency and throughput are the two numbers you use to describe how a system performs. Latency is how long one request takes. Throughput is how many requests the system handles per second. They are related but not the same, and improving one can hurt the other.

Every design discussion about performance comes back to these two, plus the targets you promise around them. This note defines both, shows how to improve each, and gives ballpark targets to start from.

Definitions#

The two terms answer different questions, and a fast-food counter makes the gap easy to see.

Latency Throughput
Question How fast does one request finish? How much work gets done overall?
Measured as Time: ms, µs, s Rate: requests/s (RPS), queries/s (QPS), transactions/s (TPS)
Fast-food analogy Time from ordering to getting your burger Burgers the restaurant serves per minute

Latency is usually reported as percentiles, not averages, because a few slow requests can hide behind a good-looking average. P50 is the median. P95 means 95% of requests are faster than this value. P99 catches the slow tail that averages hide.

Why the distinction matters#

Since they measure different things, you can't optimize one number and assume the other follows.

  • They trade off. Giving each request more dedicated resources can lower its latency but reduce total throughput. Batching and queueing raise throughput but make individual requests wait longer.
  • Every design needs targets for both, for example "P95 under 200 ms at 10,000 RPS".

Where they show up#

Both numbers apply to every component in a design, not only to the system as a whole. Here's what each looks like for common parts:

System Latency example Throughput example
Web API Time to return JSON for a GET Requests handled per second
Database Time to run one query Queries per second
Message queue Time to enqueue or dequeue a message Messages processed per second
Video streaming Delay before playback starts Concurrent streams served

How to improve each#

Because the two trade off, the techniques that move each number are different.

Lower latency (faster per request)#

  • Cache frequently read data (Redis, Memcached).
  • Shorten call chains: fewer hops between microservices.
  • Load balance so no node is overloaded.
  • Use better algorithms and indexes.
  • Return partial results early (progressive rendering).
  • Move servers and data closer to users (Multi-Region Latency and Failures).

Higher throughput (more requests overall)#

  • Scale horizontally: add servers.
  • Batch work into chunks.
  • Process asynchronously with queues and workers.
  • Partition or shard data so work spreads across machines.

Ballpark latency targets#

Improving a number only helps once you know what "fast enough" means. These are rough, commonly used expectations for user-facing systems, usually stated at P95 or P99. Treat them as a starting point for discussion, not as standards. Real targets come from your product's requirements.

System Operation Rough target
Web APIs Standard CRUD (profile lookup, settings update) 100–300 ms
Read-heavy, served from cache < 50–150 ms
Write-heavy (posting a comment) 150–500 ms
Search Small dataset 100–300 ms
Large, many shards 300–800 ms
Autocomplete / typeahead < 100 ms (must feel instant)
Messaging 1:1 chat message < 100 ms
Typing indicator, presence < 50 ms
Push notification < 500 ms
In-app notification 200–500 ms
Files and media Acknowledge a small upload < 500 ms
Large upload Chunked and progressive
Thumbnail fetch < 100 ms
Video playback start 1–2 s
Payments Authorization, confirmation < 2 s
Balance inquiry < 500 ms
Fraud check < 300 ms (sometimes async)
URL shortener Redirect < 50 ms
CDN Edge cache hit < 50 ms
Edge miss (origin fetch) 100–500 ms
Auth Token generation < 200 ms
Session validation < 100 ms
2FA code check < 500 ms

A handy way to state a target: "This should respond in about X ms at P95."

SLA, SLO and SLI#

Once you pick a target, you need words for promising it and checking it. Three related terms cover that.

Term What it is Who it's for Example
SLA (service level agreement) A formal promise to customers, often with penalties (credits, refunds) if broken External, contractual "99.9% of requests complete in < 500 ms each month."
SLO (service level objective) The internal target your team aims for, stricter than the SLA Internal, measurable "99.95% of requests complete in < 500 ms."
SLI (service level indicator) The measured value Dashboards and alerts "Last month, 99.97% completed in < 500 ms."

Why the SLO is stricter than the SLA#

The table above sets the SLO tighter than the SLA on purpose, because you never want to run exactly at the SLA. If you promise 99.9% and engineer for exactly 99.9%, any bad deploy or cloud hiccup immediately breaks the contract. Setting a tighter SLO gives you a safety margin. Here's how the three numbers line up in practice:

Level Value Role
SLA (promise to customers) 99.9% The contract
SLO (internal target) 99.95% Stricter, so you get early warning
SLI (what you measured) 99.98% Compare against the SLO and alert before the SLA is at risk

With this margin you have room for incidents, you spot problems before customers do, and you avoid penalties.

Key takeaways#

  • Latency is time per request. Throughput is requests per unit of time.
  • Measure latency with percentiles (P95, P99), not averages.
  • Caching, fewer hops and proximity cut latency. Horizontal scaling, batching, async work and sharding raise throughput.
  • Batching and queueing usually trade higher latency for higher throughput.
  • SLA is the external promise, SLO the stricter internal target, SLI the measurement.
Revision notes · 2 min

Core idea#

Latency is how long one request takes. Throughput is how many requests the system handles per second. They are related, and improving one can hurt the other.

Key points#

  • Measure latency with percentiles, not averages. P50 is the median. P99 catches the slow tail.
  • Throughput is a rate: RPS, QPS or TPS.
  • Batching and queueing raise throughput but make each request wait longer.
  • Every design needs targets for both, for example "P95 under 200 ms at 10,000 RPS".
  • Every component has both numbers: APIs, databases, queues, streaming.

How to improve each#

Lower latency Higher throughput
Cache hot data (Redis, Memcached) Scale horizontally
Fewer hops between services Batch work into chunks
Load balance so no node is overloaded Process async with queues and workers
Better algorithms and indexes Partition or shard data
Move servers and data closer to users

Ballpark targets (P95 or P99)#

  • Standard CRUD API: 100–300 ms. Cached reads: under 50–150 ms.
  • Autocomplete: under 100 ms. Typing indicator: under 50 ms.
  • URL shortener redirect and CDN edge hit: under 50 ms.
  • Video playback start: 1–2 s. Payment authorization: under 2 s.
  • These are starting points for discussion. Real targets come from product requirements.

SLA, SLO and SLI#

Term What it is Example
SLA External promise, with penalties if broken 99.9%
SLO Internal target, stricter than the SLA 99.95%
SLI The measured value 99.98%
  • Set the SLO stricter than the SLA. The margin absorbs bad deploys and gives early warning.
  • Compare the SLI against the SLO. Alert before the SLA is at risk.

Pitfalls#

  • Averages hide the slow tail.
  • Engineering for exactly the SLA means any incident breaks the contract.
  • Optimizing one number does not mean the other follows.

Say it in an interview#

  • "This should respond in about 200 ms at P95, at 10,000 RPS."
  • "Caching and proximity cut latency. Horizontal scaling and async work raise throughput."

Found a mistake? Email ask@bigonotes.com