Bandwidth Latency and Request Concurrency

Back of the Envelope Estimation · 35 min

System Design · Module 4 · Lesson 3 of 4 · 35 min

Bandwidth Latency and Request Concurrency

Separate bytes per second from request time, compare complete paths, and use average in-flight work without mistaking it for a tail-latency guarantee.

Bandwidth is a rate, latency is a duration, and concurrency relates work arriving to work still in progress.

01 The idea

The problem this lesson solves

200 responses/s × 2,000 bytes gives 400,000 bytes/s.

Prerequisite: earlier lessons introduce the vocabulary and shared examples used here. Follow the module order.

BandwidthA data transfer rate, often stated in bits per second.
LatencyElapsed time for a named operation across a defined boundary.
ConcurrencyThe amount of work in progress at the same time.

02 Worked example

Follow one worked example

Bandwidth Latency and Request Concurrency worked diagram01200 responses/s× 2,000 bytes02400,000 B/s× 8 bits/byte033.2 MbpsPayload only04200 × 0.05 s10 in flightKeep the units and assumptions visible at each step.Bandwidth Latency and Request Concurrency compact diagram01200 responses/s× 2,000 bytes02400,000 B/s× 8 bits/byte033.2 MbpsPayload only04200 × 0.05 s10 in flight
200 responses/s: × 2,000 bytes • 400,000 B/s: × 8 bits/byte • 3.2 Mbps: Payload only • 200 × 0.05 s: 10 in flight.

Trace the example in order. Follow the same identities, units and state transitions through the diagram and the events below.

1
Count payload200 responses/s × 2,000 bytes gives 400,000 bytes/s.
2
Convert unitsMultiply by 8 to obtain 3.2 Mbps payload.
3
Count in-flight workAt 50 ms mean time, 200 × 0.05 gives ten average in-flight requests.
4
Slow the dependencyAt 200 ms, the same calculation gives forty; unbounded waiting now needs more resources.

Bandwidth is a rate, latency is a duration, and concurrency relates work arriving to work still in progress.

03 The method

Mechanisms decisions and a guided tutorial

Work through the explanation in order, then apply it in the tutorial. Each comparison names a cost as well as a benefit.

Choice or conceptPurposeBoundary or cost
BandwidthBytes transferred per unit timeCompare bits/s with bits/s
LatencyDuration of one pathState sequence and boundary
Average concurrencyRate × mean timeRequires stable matching averages
Tail latencySlow-end distributionMeasure under representative load

Size network traffic in bits when comparing link rates

If each redirect response averages 1,000 bytes, the peak response payload is 57.87 × 1,000 ≈ 57,870 bytes/s. Multiply by eight to compare with a bits-per-second network rating: about 463,000 bits/s, or 0.463 Mbps. This is only modeled response payload. Request bytes, headers, TLS, retransmissions and replication add traffic. An image or video service can be bandwidth-bound long before its API becomes CPU-bound.

Use Little's Law with matching boundaries

For a stable system, average in-flight work is approximately arrival rate × average time in the system. At 200 requests/s and 0.05 seconds average service time, about 10 requests are in flight on average. This can help reason about concurrency, but it is not a p99 bound or a safe connection-pool size by itself. A slower dependency increases in-flight work even if incoming QPS is unchanged.

Convert payload to a network rate

At 200 responses per second and 2,000 bytes per response, payload throughput is 400,000 bytes/s. Multiply by eight to obtain 3.2 million bits/s, or 3.2 Mbps. Headers, request traffic, TLS overhead and retransmissions add to that payload model.

A large-file service can be network-bound at low request QPS. A tiny response can have low bandwidth demand but high latency because it waits on a slow dependency. Choose the resource model for the actual path instead of using QPS as a universal capacity measure.

Add only the costs on the path

A serialized request with 10 ms application work and a 40 ms database call has a modeled 50 ms path before other costs. Two independent calls performed concurrently have a different model from two calls performed in sequence. State dependency order before adding latencies.

A weighted average of cache-hit and cache-miss times estimates a mean under the assumed costs. It does not predict p99. During overload, queueing can make the miss path much slower than its isolated benchmark, so the distribution changes along with the traffic.

Use Little’s Law with matching boundaries

For stable long-run averages, in-flight work is approximately arrival rate multiplied by average time in the measured system. At 200 requests/s and 0.05 seconds average time, the modeled average concurrency is ten. If the dependency slows to 0.2 seconds at the same stable rate, it becomes forty.

This is not a safe thread-pool size or a p99 guarantee. Retries, burstiness and waiting policies affect the actual distribution. Bound concurrency and deadlines so a slow dependency cannot accumulate unlimited in-flight work. Measure throughput and queueing together when testing capacity.

Guided tutorial

1. Make a unit sheet

Write bytes, bits, milliseconds and seconds conversions.

2. Draw two paths

Compare sequential and independent parallel dependencies.

3. Calculate concurrency

Use the same arrival rate with two mean service times.

4. Set boundaries

Specify a timeout and maximum in-flight limit for the slow path.

payload_bits_per_second = qps * response_bytes * 8
sequential_latency = app_time + dependency_time
average_in_flight = arrival_rate * average_time_seconds
# These are models with explicit boundaries, not p99 guarantees.

04 Cheat sheet

Review the decisions

Use this table to explain the mechanism and its limit without memorizing a product name.

Choice or conceptRememberCheck
BandwidthBytes transferred per unit timeCompare bits/s with bits/s
LatencyDuration of one pathState sequence and boundary
Average concurrencyRate × mean timeRequires stable matching averages
Tail latencySlow-end distributionMeasure under representative load
BandwidthA data transfer rate, often stated in bits per second.
LatencyElapsed time for a named operation across a defined boundary.
ConcurrencyThe amount of work in progress at the same time.

05 Where & why

Check the primary references

Use official references for protocol and implementation details. The questions here are teaching prompts.

Primary reference
Google SRE overload handling

Read Google SRE overload handling

Primary reference
Google SRE service-level objectives

Read Google SRE service-level objectives

State the implementation version and the workload assumptions when defending your own design.

06 Interview questions

Explain the reasoning out loud

Answer before opening the explanation. The questions progress from vocabulary to decisions and failure behavior.

What does Bandwidth mean?
A data transfer rate, often stated in bits per second.
What does Latency mean?
Elapsed time for a named operation across a defined boundary.
What does Concurrency mean?
The amount of work in progress at the same time.
Can a fast network fix a two-second database wait?
Usually it cannot remove a delay dominated by database waiting. Locate the time on the actual request path first.
Why multiply response bytes by eight?
Network capacity is commonly rated in bits per second. A byte contains eight bits, so the units must agree.
Does Little’s Law set a connection-pool maximum?
No. It relates averages within a stable system. Safe limits need burst, queueing, timeout and workload measurements.
Can independent calls always be added?
Their latency depends on whether they execute sequentially or in parallel and on shared contention. Draw the dependency order first.
Why can p99 worsen without higher incoming QPS?
A slower dependency can build queues and increase in-flight work. The same arrival rate can produce a much worse latency distribution.

07 Practice problems

Practice a new case

Solve the new cases before revealing hints. Complete worked solutions follow the set.

Bytes to bits

Easy
Calculate payload bandwidth for 200 responses/s of 2,000 bytes each in Mbps.
Follow-up
Network ratings use bits.
Show the hint
Multiply bytes/s by eight.

Name the metric

Easy
Classify 40 ms and 20 Mbps as duration or rate.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Read the units.

Sequential path

Medium
Sum a 5 ms handler, 12 ms lookup and 3 ms serialization step that run sequentially.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Do not omit the final stage.

Concurrency

Medium
Estimate average in-flight work at 500 requests/s and 80 ms mean time.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Convert milliseconds to seconds.

Payload comparison

Medium
Compare bandwidth for 100 QPS of 1 KB responses and 10 QPS of 1 MB responses in decimal units.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Lower request count can move more data.

Latency review

Hard
A service has a low mean latency but poor p99 during cache misses; propose a measurement and control plan.
Follow-up
State the assumption or edge case that makes the answer correct.
Show the hint
Inspect misses and the backing-store queue separately.

Worked solutions

1. Bytes to bits

200 × 2,000 = 400,000 bytes/s. Multiplying by eight gives 3,200,000 bits/s = 3.2 Mbps, before protocol overhead.

2. Name the metric

40 ms is a latency duration; 20 Mbps is a transfer rate.

3. Sequential path

The modeled path totals 20 ms before unmodeled network and queueing costs.

4. Concurrency

500 × 0.08 = 40 average in-flight requests under matching stable-boundary assumptions.

5. Payload comparison

The first is 100 KB/s or 0.8 Mbps. The second is 10 MB/s or 80 Mbps, one hundred times as much payload bandwidth.

6. Latency review

Measure hit and miss distributions, origin concurrency, timeouts and saturation under warm and cold scenarios. Add bounded rebuild concurrency and admission behavior; do not infer p99 from a weighted mean.