Core Fundamentals

Throughput

0 of 6 complete

0%

Contents

Back|Core FundamentalsThroughput
1/6
9 min left
  1. Home
  2. System Design: Foundation
  3. Core Fundamentals
  4. Throughput
Prerequisites
Latencyrequired
Related Topics
Local CacheCaching StrategiesObject StorageDatabase Types & Storage
Previous lessonLatencyNext lessonBandwidth

System Design

  • Foundation
  • Intermediate
1 of 6
  • Advanced
  • Capstone
  • AI Engineering

    • Foundation
    • Data, RAG and Agents
    • Evaluation, LLM Ops and Security

    systemdesign.academy

    • Home
    • Glossary
    • Interview prep
    • Reviews
    • About
    • Privacy
    • Terms

    this free lesson is part of

    System Design Masterclass

    • 770 lessons, beginner to principal
    • 90 real interview systems taken apart step by step
    • An AI tutor beside every lesson that answers and draws
    • Lifetime access, every new lesson included

    $49 once, by PayPal

    See the System Design course

    Save your progress and get the interview checklist PDF

    System Design Interview Cheat Sheet: the 7 interview stages, the 10 points a scorecard grades, 12 classic systems. 18 pages. Free with an account.

    Where this shows up in interviews

    This idea carries a full system design question on its own. Each walks through the full answer.

    • →Design an LLM Inference Platform

    you just read a free lesson from

    System Design Masterclass

    • 770 lessons, beginner to principal
    • 90 real interview systems taken apart step by step
    • An AI tutor beside every lesson that answers and draws
    • Lifetime access, every new lesson included

    $49 once, by PayPal

    See the System Design course

    Why Should You Care About Throughput?

    In the last lesson, you learned about , how long it takes to handle one request. But here's a question latency alone can't answer:

    What happens when a million people show up at the same time?

    Think about a restaurant again. A restaurant might serve one customer in 10 minutes (that's latency). But can it serve 500 customers in an hour? That depends on something entirely different: how many orders it can process in parallel, how big the kitchen is, and how many chefs are working.

    That ability to handle volume? That's throughput.

    Throughput matters because real systems don't serve one user at a time. Consider these numbers:

    • Google handles over 99,000 search queries every single second
    • Visa processes approximately 65,000 transaction messages per second at peak
    • Twitter/X sees surges of 140,000+ tweets per second during major global events

    If these systems had great latency (fast for one request) but poor throughput (couldn't handle many requests), they would collapse under load. Throughput is what separates a prototype that works on your laptop from a production system that works for millions of users.

    What Exactly Is Throughput?

    Throughput is the amount of work a system can complete in a given period of time.

    It's usually measured as:

    • Requests per second (RPS), how many API calls a server can handle
    • Transactions per second (TPS), how many database transactions complete
    • Queries per second (QPS), how many database queries are processed
    • Megabits per second (Mbps), for network data transfer

    The Restaurant Analogy

    Let's make this concrete:

    Restaurant MetricSystem Equivalent
    Customers served per hourRequests per second
    Number of tablesAvailable connections
    Number of chefs in the kitchenCPU cores / worker threads
    Kitchen capacity (stoves, ovens)Memory and processing power
    How fast one dish is prepared

    The Highway Analogy

    One of the best ways to understand throughput is the highway analogy. Let's build this up step by step.

    Measuring and Improving Throughput

    How Is Throughput Measured?

    Engineers measure throughput using load testing tools. The basic approach is:

    1. Send increasing amounts of traffic to the system
    2. Measure how many requests complete successfully per second
    3. Find the breaking point, where throughput stops increasing and starts dropping

    Common metrics to watch:

    MetricWhat It Tells You
    Requests Per Second (RPS)How many complete requests the system handles each second
    P50 / P99 The latency experienced by the median user (P50) vs. The slowest 1% (P99). When throughput is near capacity, P99 spikes dramatically.
    Error RatePercentage of requests that fail. High error rates mean you've exceeded your throughput ceiling.
    CPU / Memory UsageHow much of your resources are consumed. If CPU hits 100%, throughput can't increase.

    The Throughput-Latency Relationship

    Here's a critical concept many beginners miss:

    The Latency-Throughput Trade-off

    One of the most important lessons in system design is that and throughput are connected, and sometimes improving one hurts the other.

    When They Work Together

    Sometimes you can improve both. is a great example:

    • Cached responses are faster (lower latency)
    • The server does less work per request, so it can handle more (higher throughput)

    When They Conflict

    But often there are real trade-offs:

    Batching increases throughput but increases latency. Imagine a bus vs. A taxi:

    • A taxi leaves immediately when you get in, low latency, low throughput (1 person per trip)
    • A bus waits until it's full before departing, higher latency per person, but much higher throughput (40 people per trip)

    Test Your Understanding

    Knowledge Check

    3 questions - Score 80% to pass

    Q1

    What is throughput?

    Q2

    A server can handle 100 requests per second with an average latency of 50ms. During a traffic spike, the server receives 200 requests per second. What is most likely to happen?

    Q3

    A ride-sharing company batches nearby ride requests together to assign them more efficiently. What is the trade-off?

    (single request time)

    A restaurant with 1 chef might make 10 meals per hour. Add 3 more chefs? Now it can make 40 meals per hour. The time to make one meal (latency) didn't change, but the number of meals completed per hour (throughput) quadrupled.

    Throughput vs. Latency: They're Related but Different

    This is an important distinction:

    • Latency = how long ONE request takes (time per operation)
    • Throughput = how many requests the system handles TOTAL (operations per time)

    You can have low latency but low throughput, a single blazing-fast server that can only handle one request at a time. Or you can have higher latency but high throughput, a system that takes a bit longer per request but can handle thousands simultaneously.

    The goal is usually to optimize both, but in practice there are trade-offs (more on this later).

    Because they are independent, it helps to stop thinking of them as one dial and start thinking of them as two axes. Here is where some real systems actually sit.

    after “What Exactly Is Throughput?”

    Wondering what goes wrong when this gets busy?

    Pick it up in Latency, from the System Design course.

    It is one of the free lessons, so you can open it right now.

    Look inside the System Design course

    As throughput approaches maximum capacity, latency spikes.

    Think about it: when the highway is empty, you cruise at full speed (low latency). As more cars fill the road, everyone slows down (latency increases). At some point, adding more cars doesn't increase throughput at all, it just makes everything slower.

    This is why production systems aim to stay at about 60-70% of maximum throughput. Going above that means any small spike in traffic causes latency to skyrocket.

    And it gets worse than slow. Past the ceiling, a real system does not politely plateau, it finishes fewer requests than it did before.

    The equation that ties the two together

    There is one line of arithmetic connecting everything in this lesson, and it is called Little's Law: the number of requests in flight equals the arrival rate multiplied by how long each one takes. Concurrency = throughput x latency.

    That sounds abstract until you use it to find a ceiling you did not know you had.

    Common Ways to Increase Throughput

    StrategyHow It WorksHighway Analogy
    Vertical ScalingGet a bigger, faster serverWiden each lane so cars can go faster
    Horizontal ScalingAdd more serversBuild more highways
    Store frequent results so you skip processingCreate express lanes for regular commuters
    Async ProcessingHandle non-urgent work in the backgroundLet delivery trucks use the road at night
    Database OptimizationSpeed up the slowest componentRemove the bottleneck intersection
    Load BalancingDistribute traffic across serversTraffic signs directing cars to emptier routes

    The first two of those are the big ones, and they are not interchangeable.

    after “Measuring and Improving Throughput”

    Reading it is one thing. Explaining it out loud is harder.

    In the System Design course, the next step is Vertical Scaling.

    About 20 minutes, and you can stop and come back any time.

    See what the course covers

    Many real systems use batching. When you send a message on WhatsApp, it doesn't immediately sync to every server. Messages are batched together and synced periodically, slightly higher latency, but vastly better throughput.

    Processing overhead is another example. Adding encryption to every request makes it more secure, but the CPU time spent encrypting and decrypting increases latency and reduces throughput.

    The Rule of Thumb

    For most applications:

    • User-facing requests: Optimize for latency first (users hate waiting)
    • Background jobs: Optimize for throughput first (process as much as possible)
    • Data pipelines: Throughput is almost always the priority

    Understanding when to prioritize which metric is one of the key skills that separates junior engineers from senior ones.

    after “The Latency-Throughput Trade-off”

    This is where most answers get vague.

    The System Design course gives this its own lesson: Caching.

    You come away able to explain the trade-offs out loud.

    Open the System Design course page $49 once, lifetime access