Stage 0 · Interview method · Easy · 15 min
Latency, throughput and availability
Learn the three numbers that say how well a system runs: latency, throughput and availability. See why the p99 shows what an average hides.
What each interview level is expected to know
Learn first: Functional and non-functional requirements
In AI systems: How a model writes, one token at a time
After this lesson you can:
- Explain latency, throughput and availability, and how they differ.
- Read a p99 and say what an average hides.
- Work out the availability of parts that depend on each other in a chain.
Start here
See it in 60 seconds
Latency, throughput and the nines
Latency is how long one request waits, throughput is how many finish each second, and availability is how often the service answers.
Scene 1 of 6 · One request's wait
Latency is the wait for one answer: this request took 115 ms from asking to reply.
- Users — healthy
- Server — healthy
- This request took
- 115 ms
- Throughput
- not shown yet
- p50
- not shown yet
- p99
- not shown yet
- One request's wait. Latency is the wait for one answer: this request took 115 ms from asking to reply.
- Many every second. Throughput is how many requests finish each second; this server finishes 200.
- Waits are not equal. Timing 100 requests shows that most finish fast, but a few take much longer.
- p50: the middle. p50 is the middle wait: half of the requests finished within 115 ms.
- p99: the slow tail. p99 is 595 ms, yet a page of 50 requests gets at least one that slow 39% of the time.
- Availability in nines. Availability is the share of time a service answers; each extra nine cuts the allowed downtime to a tenth.
- Now you try. Pick an availability target and see how much downtime a year it allows. For example: 99.9% availability allows about 8.8 hours of downtime a year. That is 0.1% of the 525,600 minutes in a year; each extra nine needs more spare servers and care.
Scene 1 of 6: One request's wait. Latency is the wait for one answer: this request took 115 ms from asking to reply.
Key points
- Latency is the wait for one answer; throughput is how many answers finish each second.
- An average hides slow requests; p50 shows the typical wait and p99 shows the slow tail.
- A page that makes 50 requests gets at least one slower than p99 39% of the time.
- 99.9% allows about 8.8 hours down a year; 99.99% allows about 53 minutes.
In plain words
Say a shop's site finishes 200 requests each second. Most are answered in about 100 ms, a few take over half a second, and the site was down for one hour last month. Those are the three basic measures. (How long one request takes, from sending it to getting the answer.) is how long one request takes. (How much work a system finishes each second.) is how many requests the system finishes each second. (The share of time a service answers requests correctly, such as 99.9% of a year.) is the share of time it is up and answering.
The three numbers pull against each other. Push more requests through one server, and each one waits longer in line. Buy more availability, and you pay for spare machines that sit idle most of the time. Latency is read as a (The wait that a given share of requests beat. The 99th percentile, p99, is the wait that 99 in 100 requests are faster than.), such as the (The time within which 99 out of 100 requests finish. The slowest 1% take longer.), because an average hides the slow requests. Throughput is often written as (Queries per second: how many requests a system receives or handles in one second.), queries per second.
The problem it solves
"Fast and reliable" cannot be tested. Is a page that loads in 2 seconds fast? Is one hour of downtime a month reliable? A target with a number can be checked: 99% of requests within 200 ms, up 99.9% of the time. It also stops a team paying for more reliability than its users would notice.
Why it matters
Most parts you add to a design are there to move one of these numbers. A (A small, fast store that keeps copies of popular data, so most reads skip the slower database.) lowers latency. More servers raise throughput. A spare copy in a second data centre raises availability. So you need the numbers before you can say what a part is for, or whether it is worth its cost.
A worked example
Say a single server handles one request at a time, and each takes 5 ms. Its throughput is then about 200 requests per second, since 1,000 ÷ 5 = 200. Adding a second identical server roughly doubles that to 400 requests per second, even though each request still takes 5 ms.
Think of it like…
Think of a restaurant kitchen. Latency is how long one plate takes to cook. Throughput is how many plates leave the kitchen each minute. Availability is whether the kitchen is open when you arrive.
Where this analogy stops working
A kitchen is open or shut, and every diner can see which. A service is often partly up: it answers most requests and fails some. So availability is counted as the share of requests that succeed. Latency is read as a percentile, not as one cooking time.
Try it
See it working
Also try: Capacity estimation · Queues & backpressure
Mechanics
How it works
Four numbers describe how a system behaves: how much it does, how fast, how often it works, and how fast its parts are. The picture shows why one of them, latency, is given as percentiles.
Throughput (QPS)
Throughput is how much work the system finishes each second. It is often counted as queries per second (QPS). A server that finishes 200 requests each second has a throughput of 200 QPS.
Latency percentiles
Pick a case to follow belowWith this case: Every request took 40 ms, so the average, p50 and p99 were all 40 ms.
Users, 100 requests Users 100 requests App server, answers from memory, NOW App server answers from memory 100 requests NOW Database, a slow read Database a slow read - Users — 100 requests — healthy
- App server — answers from memory — healthy — NOW — 100 requests
- Database — a slow read — healthy
- Requests
- Answers
Step 1 of 4Step 1 of 4 · App server
Done: 100 requests arrive
- What happens
- Each request asks for a user profile.
- Why
- Latency is measured for each request, not for the server as a whole.
- What changes
- The server times every answer.
- Next
- 100 answers take 40 ms
Average–(The time within which half of all requests finish.)–(The time within which 99 out of 100 requests finish. The slowest 1% take longer.)–not yetStep 1 of 4: App server. 100 requests arrive. Each request asks for a user profile.
What these pictures simplify. The times are round examples: 40 ms from memory and 900 ms with a slow database read. Real services see a spread of times, and monitoring tools measure percentiles over thousands of requests. Some tools work out a percentile slightly differently.
Latency is how long one request takes. Sort all requests from fastest to slowest. The (The time within which half of all requests finish.) is the middle one. The p99 is the time that 99 of every 100 requests beat, so it shows what the slowest users feel.
In the picture, 100 requests reach one server. In the second case, 98 are answered in 40 ms and 2 wait 900 ms on a slow database read.
The average is about 57 ms, which looks fine. Sorted, the p50 is still 40 ms, but the p99 is 900 ms. That is why targets use the p99: the average hides the slow requests.
Availability
Availability is the share of time the system works. 99.9% ("three nines") allows about 8.8 hours of downtime a year. 99.99% ("four nines") allows about 53 minutes. A written promise of this kind to customers is a service level agreement (SLA).
Hardware latency numbers
Reading from memory (RAM) takes about 100 nanoseconds. Reading from an (Solid-state drive: storage on memory chips with no moving parts. It reads from random places far faster than a spinning disk.), a disk with no moving parts, takes about 150 microseconds, which is 1,500 times longer. A network round trip inside one data centre takes about 0.5 milliseconds. These rough figures come from a list often credited to Jeff Dean of Google. Real hardware varies.
Use it when
- Setting targets at the start of a design: say the latency, throughput and availability you aim for before you draw any box.
- Finding the slow part of a system: measure the latency of each step, and fix the biggest one first.
- Writing a (A target for how reliable a service should be, such as 99.9% of requests succeeding.) (SLO): it is a target for one of these numbers, such as 99.9% of requests succeeding.
Skip it when
- A prototype or a small internal tool: a strict target takes time to measure and to meet. A few users will tell you if it is slow.
- Per-request latency targets for a batch job, such as a nightly report: what matters there is that the whole job finishes on time.
Check yourself
Judgement
Trade-offs and how it fails
What you give up
- Performance
- Latency and throughput pull against each other. Sending work in batches raises throughput, but each request waits for its batch, so its latency goes up. A low p99 also usually means servers that run well below full load, so a burst of traffic does not form a (A waiting line for work. One part adds messages, and another takes them off and handles them later, at its own pace.).
- Cost
- 99.9% allows about 8.8 hours of downtime a year, and 99.999% allows about 5 minutes. Getting there usually takes spare copies in more than one region and automatic (Switching to a backup, such as promoting a replica to primary, after the original one fails.), which costs far more.
Failure modes
- Watching the average instead of the p99. Say 990 requests take 10 ms and 10 take 2 seconds. The average is about 30 ms, which looks healthy, yet 1 request in 100 took 2 seconds.
- Forgetting that availability multiplies. A request that needs three services, each up 99.9% of the time, succeeds only about 99.7% of the time (0.999 × 0.999 × 0.999). That assumes they fail independently.
In the real world
- In a 2006 talk, Amazon reported that adding 100 ms of delay to a page cut sales by about 1%.
- In a 2006 Google test, a results page that was 0.5 s slower (and also showed 30 results) lost 20% of its traffic. Source: Greg Linden, "Marissa Mayer at Web 2.0" (2006) (checked 14 October 2026)
Trade-offs to be ready to discuss: Latency vs throughput
Check yourself
Interview
What interviewers look for
- Give latency as a percentile, not an average: "p99 under 200 ms" says what the slowest requests get.
- Turn availability into downtime out loud: "99.9% is about 8.8 hours a year. Is that acceptable for payments?"
Say it out loud: Why is average (mean) latency a misleading number to watch?
Expected depth by interview level
Levels describe the depth interviewers probe, not years of experience. Choose a level on the learning path to highlight it.
- JuniorExpected
- Know latency, throughput and availability, and how fast memory, disk and network are.
- MidCore
- Use percentiles, not averages, and reason about a latency budget.
- SeniorCore
- Set targets per path and explain what dominates p99.
- StaffExpected
- Tie each reliability target to its cost and to what users feel.
Practice
Apply it
Three harder questions
The first two use the idea on a new case. The last asks you to judge a design.
Apply it
Apply it
Judge a design
Go deeper
Sources and further reading
First-hand sources to check this page against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.
- Research paperThe Tail at Scale (2013)Dean and Barroso, Communications of the ACMWhy the slowest 1% of requests matters more as one page calls more servers.
- Engineering guideService Level ObjectivesGoogle SRE bookHow Google picks what to measure, sets targets for it, and why 100% is the wrong target.
- Engineering guideEmbracing RiskGoogle SRE bookHow an availability target turns into minutes of allowed downtime, and what each extra nine costs.