AlgoMaster Logo

Latency vs Throughput vs Bandwidth

High Priority12 min readUpdated October 13, 2026
AI Mock Interview

Practice this topic in a realistic system design interview

Listen to this chapter
Unlock Audio

Premium Video

This video is available to premium subscribers only

Unlock Full Access

When discussing system performance, three terms come up frequently: latency, throughput, and bandwidth.

These terms are often used interchangeably, but they measure different things. Understanding the difference matters because improving one doesn't necessarily improve the others.

In this chapter, we'll explore what each metric measures, how they relate to one another, and why increasing bandwidth doesn't always make a system faster. We'll also look at practical ways to improve latency, throughput, and bandwidth when designing systems.

1. A Simple Way to Picture Them

Let's start with a simple analogy. Imagine a highway connecting two cities.

Loading simulation...

  • Bandwidth is like the number of lanes on the highway. It determines how many cars the road can carry at the same time.
  • Throughput is the number of cars that actually reach the other city per hour. Under ideal conditions, it can be close to the highway's maximum capacity. But if there's an accident or roadwork, it can drop significantly.
  • Latency is the time it takes a single car to travel from one city to the other.

The important thing to understand is that these are three different measurements.

Adding more lanes allows more cars to travel simultaneously, but it doesn't necessarily make an individual car reach its destination faster. The distance and speed limit remain the same.

The same principle applies to computer systems. Now let's understand each of these metrics in more detail, starting with latency.

2. Latency

Latency measures how long it takes for something to travel from one point to another.

  • In networking, it's typically the time a packet takes to reach its destination.
  • For an application, it's the time between a client sending a request and receiving a response. This is often called round-trip time (RTT) at the network level.

Latency is measured in units of time, usually milliseconds or microseconds.

Latency = Total Round-Trip TimeProcessing(50ms)Total Latency: 150msRequest (t=0ms)Response (t=150ms)ClientServer
5 / 5
algomaster.io

Where Network Latency Comes From

Network latency comes from several sources.

1. Propagation delay is the time a signal takes to physically travel across the network.

Light travels through fiber at roughly 200,000 km per second, about two-thirds of its speed in a vacuum. The distance between New York and London is around 5,600 km, so even with a perfectly straight fiber cable:

In reality, cables don't follow straight paths, so actual round-trip times are often closer to 70 or 80 ms.

This delay is limited by the laws of physics, so the most effective way to reduce it is to move data closer to users.

2. Transmission delay is the time needed to put all the bits of a message onto the network link. Larger messages naturally take longer to transmit, and slower links take longer too.

3. Queuing delay occurs when packets have to wait in a router's buffer because the link is busy.

4. Processing delay is the time network devices spend examining and forwarding packets.

Latency of a Full Request

When we measure the overall latency of an application request, we also need to account for server processing time, including parsing the request, querying databases, calling other services, and preparing the response.

A request on a new connection also pays some one-time setup costs before it can even be sent: a DNS lookup to find the server's address, a TCP handshake, and a TLS handshake for HTTPS. Each of these adds at least one round trip.

3. Measuring Latency with Percentiles

A common mistake is measuring latency using only the average.

Suppose a service handles 100 requests. 98 of them finish in 50 ms, while the remaining 2 take 2 seconds.

The average comes out to just 89 ms, which sounds pretty good. But two users still had to wait two full seconds, and the average doesn't reflect that experience.

That's why latency is usually measured using percentiles:

Scroll
MetricMeaningIn our example
P50 (median)50% of requests finish within this time50 ms
P9595% of requests finish within this time50 ms
P9999% of requests finish within this time2 s

In other words, P99 helps us understand how slow the worst 1% of requests can get. In our example, the P50 is 50 ms, but the P99 is 2 seconds.

Tail Latency

These unusually slow responses are known as tail latency, and they can have a much bigger impact than you might expect.

Imagine a web page that makes 20 backend calls in parallel and can only finish loading when the slowest call completes. If each call independently has a 1% chance of being slow:

So even though only 1% of backend requests are slow, they can end up affecting nearly one in five page loads. The more services a request fans out to, the more the tail matters.

4. Bandwidth

Bandwidth is the maximum amount of data a network connection can carry per unit of time. It's typically measured in bits per second, such as megabits per second (Mbps) or gigabits per second (Gbps).

When an internet provider offers a 1 Gbps connection, or a cloud provider says a virtual machine supports 10 Gbps of network bandwidth, they're referring to its maximum capacity.

Bits vs Bytes

One important distinction is bits versus bytes. Network speeds are usually measured in bits, while file sizes are measured in bytes. Since one byte equals eight bits:

A 1 Gbps connection can theoretically transfer up to 125 megabytes per second.

But the key word here is maximum. Bandwidth tells us how much data a connection is capable of carrying, not how much data is actually being transferred.

The same idea applies inside a machine. Disks, memory, and internal buses each have their own bandwidth, and any of them can be the limit:

TypeRough capacity
Network1 to 100 Gbps per server
Disk (SATA SSD)~500 MB/s
Disk (NVMe SSD)several GB/s
Memory (RAM)tens of GB/s

That brings us to our next metric: throughput.

5. Throughput

Throughput measures how much work a system actually completes per unit of time.

  • For a network connection, it's the amount of data successfully delivered per second.
  • For an application, it's typically measured in requests per second (RPS), transactions per second (TPS), or messages processed per second.

Network throughput cannot exceed the available bandwidth, and in practice, it's usually lower for several reasons:

  • Protocol overhead: every packet contains headers for protocols like Ethernet, IP, and TCP, so some of the bandwidth is used for headers rather than actual data.
  • Retransmissions: lost packets must be retransmitted, consuming additional bandwidth without delivering new data.
  • Congestion control: TCP adjusts its sending rate based on network conditions, which means a connection may not fully use the available bandwidth.

The Bottleneck Sets the Limit

But often, the network isn't even the bottleneck.

Imagine a server with a 10 Gbps network connection that writes incoming data to a disk capable of handling only 200 MB per second.

The network can deliver over a gigabyte per second, but the system can only write 200 MB per second. In this case, the disk limits the overall throughput.

So a system's throughput is often determined by its biggest bottleneck. Common bottlenecks include:

Now that we've covered all three metrics, let's look at how they interact.

6. How Latency and Bandwidth Interact

A simple way to estimate transfer time is to add the network latency to the data size divided by the available bandwidth:

This helps us understand which factor matters more for a particular workload.

Small Request: Latency Dominates

Consider a small API call that transfers 1 KB of data over a 1 Gbps connection with a round-trip time of 50 ms.

  • Transmitting 1 KB (8,000 bits) takes only about 8 microseconds.
  • The round trip takes 50 milliseconds.

So almost all the time is spent waiting, not transferring data. Even upgrading to a 10 Gbps connection would make very little difference.

Large Transfer: Bandwidth Dominates

Now consider transferring a 10 GB backup over the same connection. At 1 Gbps, transferring the data alone takes around 80 seconds. Compared to that, the 50 ms of latency is almost negligible. In this case, bandwidth is the limiting factor.

Scroll
WorkloadData time at 1 GbpsLatencyWhat to improve
1 KB API call~8 µs50 msLatency and round trips
10 GB backup~80 s50 msBandwidth and throughput

So for applications that make lots of small requests, focus on reducing latency and network round trips. For large data transfers, bandwidth and throughput matter much more.

The TCP Window and the Bandwidth-Delay Product

There's another important relationship between bandwidth and latency, especially with TCP.

TCP limits how much unacknowledged data a sender can have in flight. This limit is called the window. Once it is reached, the sender must wait for acknowledgments before sending more. This means a connection's throughput can be limited to roughly:

With a 64 KB window and a 100 ms round trip, the maximum throughput is only about 640 KB per second, or roughly 5 Mbps, even if the network supports 1 Gbps.

To fully use the connection, you need enough data in flight to match what's called the bandwidth-delay product (BDP). It's simply the bandwidth multiplied by the round-trip time:

For a 1 Gbps connection with a 100 ms round trip, that's about 12.5 MB.

Modern TCP supports much larger windows and can adjust them dynamically. But this explains why high-latency connections can struggle to use their full available bandwidth, and why some large data transfers benefit from multiple parallel connections.

7. Latency and Throughput Inside a Service

Latency and throughput are also closely connected within a server. This relationship is described by Little's Law:

Suppose a service handles 1,000 requests per second, with each request taking 200 ms. On average, that means 1,000 × 0.2 = 200 requests are in progress at any given time.

Now imagine the database slows down, and each request starts taking 1 second. To maintain the same throughput of 1,000 requests per second, the service would now need to handle 1,000 × 1 = 1,000 concurrent requests.

But what if it only has 200 available threads or database connections? It won't be able to maintain that throughput:

Incoming requests start piling up in a queue, increasing latency even further. This is how a slowdown in a single dependency can cascade into a major outage.

As latency increases, the throughput a service can sustain with the same resources can drop significantly.

Little's Law is also handy for capacity planning. If a service must handle 5,000 requests per second and each request takes 20 ms, you need about 5,000 × 0.02 = 100 requests in flight. The thread pool, connection pool, or worker count must support at least that many.

8. The Trade-offs Between Latency and Throughput

Some techniques improve throughput at the cost of latency.

Batching

Batching is a good example. Instead of writing every message to disk individually, a system can collect messages for a few milliseconds and write them together.

This reduces the overhead per message and can significantly improve throughput. However, each message may have to wait for the batch to be sent, which increases latency.

  • Kafka producers let you control this trade-off through settings like linger.ms (how long to wait for more messages) and batch.size (how large a batch can get).
  • Databases use a similar technique called group commit, where multiple transactions share a single disk flush.

Utilization

Another important trade-off is server utilization.

When a server is lightly loaded, requests are usually processed quickly. But as utilization approaches 100%, incoming requests increasingly have to wait for others to finish, causing queues to build up.

The interesting part is that latency doesn't increase linearly. It may stay relatively stable at first, then rise sharply as the server approaches its capacity.

UtilizationTypical waiting time (relative to the work itself)
50%about 1×
80%about 4×
90%about 9×
95%about 19×

These numbers come from a simple queueing model, so real systems will differ. The shape is what matters: the last few percent of utilization cost far more latency than the first.

So while running a server at 95% utilization might maximize throughput, it can also lead to high and unpredictable latency. That's why production systems typically keep some spare capacity and scale up before reaching their limits.

9. Improving Latency

So how do you reduce latency in practice?

  • Move data closer to users. CDNs and multi-region deployments reduce propagation delay, which is something software optimizations alone cannot eliminate.
  • Cache frequently accessed data. Reading from memory is typically much faster than fetching data from a remote database.
  • Reduce network round trips. Reuse existing connections, combine multiple small requests into one, and run independent calls in parallel instead of sequentially. Newer protocols help here too: TLS 1.3 and HTTP/3 need fewer round trips to set up a connection.
  • Move slow operations off the critical path. If sending an email or generating a report doesn't need to finish before responding to the user, you can process it asynchronously using a queue.
  • Optimize the work itself. Add database indexes, improve queries, and reduce unnecessary processing.
  • Watch tail latency. A slow dependency, a garbage collection pause, or an unexpected retry can significantly increase your P99 latency, even when the average response time looks healthy. Timeouts on every dependency call keep one slow service from holding up everything else.

10. Improving Throughput and Using Bandwidth Well

Improving throughput usually starts with identifying and removing bottlenecks.

  • Horizontal scaling: add more servers behind a load balancer, or partition your data to distribute the workload across multiple machines.
  • Parallel processing: break large jobs into smaller tasks that can run simultaneously.
  • Batching: when latency requirements allow it, group writes, network calls, or messages instead of processing each one individually, to reduce overhead.
  • Queues: buffer incoming work to absorb traffic spikes, allowing producers to send requests at their own rate while consumers process them at a manageable pace.
  • Connection pooling: reuse database and HTTP connections instead of paying the setup cost for each request.

For bandwidth, the focus is on reducing how much data you transfer:

  • Compress responses, especially text-based formats like JSON and HTML.
  • Avoid sending unnecessary fields, and use pagination for large result sets.
  • Serve static files through a CDN, reducing bandwidth usage on your origin servers.

11. Which One Matters for Your System?

Different systems prioritize different performance metrics.

Scroll
SystemMain concernWhy
Trading platform, multiplayer gameLatencyA few milliseconds of delay can affect the outcome
Data pipeline, nightly backupThroughputFinishing the whole job on schedule matters more than any single record
Video streamingBandwidth and throughputEach viewer needs enough bandwidth, and the service needs enough total throughput for peak hours
Most user-facing appsLatency and throughputFast individual requests, and enough capacity for peak traffic

Most user-facing applications need both: low latency for individual requests and enough throughput to handle peak traffic without slowing down.

That's why performance requirements often combine the two, such as:

Keep P99 latency below 200 ms while handling 10,000 requests per second.

When designing a system, the key is to understand which of these three factors will become a bottleneck first, what's causing it, and what trade-offs you can make to improve performance.

Summary

Latency, throughput, and bandwidth measure different things. Latency is how long one request takes. Bandwidth is the maximum capacity of a connection. Throughput is how much work actually gets done per second.

Measure latency with percentiles like P50, P95, and P99, not averages. Tail latency matters more than it seems, especially when one page depends on many backend calls.

Throughput is always at or below bandwidth, and it is set by the system's biggest bottleneck, which is often not the network.

For small requests, latency dominates. For large transfers, bandwidth does. On high-latency links, the TCP window must cover the bandwidth-delay product, or bandwidth goes unused.

Little's Law ties latency and throughput together: requests in progress equal throughput times latency. When latency rises and concurrency is capped, throughput falls.

Batching and high utilization raise throughput but add latency. Reduce latency by moving data closer, caching, and cutting round trips. Raise throughput by removing bottlenecks, scaling out, and batching. Use bandwidth well by sending less data.

Quiz

Latency vs Throughput vs Bandwidth Quiz

10 quizzes