Learn

Latency and Throughput: Two Different Performance Questions

Distinguish response time from completion rate using an original queue example, and learn why averages can hide slow requests.

One request or many completions

Latency describes how long an operation takes across a defined boundary. Throughput describes how much work completes per unit time. A system can improve one without improving the other. Both need units and a clear definition of what counts as completed work.

Networking benchmarks make these distinctions explicit. RFC 2544 defines methodology for network interconnect devices, including separate throughput and latency tests. Its device-specific definitions should not be silently reused as universal application metrics. An application’s measurement boundary must fit its own job.

Follow an original service example

Imagine a worker that completes one document conversion in exactly two seconds and handles one document at a time. With a document ready immediately, its service time is two seconds and its maximum continuous completion rate under these simplified assumptions is half a document per second.

Add a second identical worker and distribute independent documents between them. Together they can complete one document per second once continuously busy, but an individual conversion still needs two seconds of service. More capacity increased aggregate throughput without making the processing of one document faster. These are hypothetical arithmetic values, not a service benchmark.

Waiting changes the experience

Now send three documents to the two workers at the same moment. Two begin immediately. The third waits for a worker, then takes its own two seconds. The first pair finish after two seconds; the third finishes after four. Its latency includes two seconds of waiting plus two seconds of service.

This is why measuring only execution time can miss the user’s experience. A system with fast processing can still feel slow when requests queue. At higher loads, retries, scheduling, and shared dependencies may change both waiting and service time. A benchmark must report its offered load and concurrency rather than presenting a latency number without context.

Choose completion units carefully

Requests per second is useful only if the requests represent comparable work. One request might process a tiny text file, while another converts a long video. A change in the mix can raise request throughput without making either kind of request faster. Report workload sizes and classes, or use a task-specific unit such as records processed per second.

Likewise, network bit rate is not the same as useful application throughput. Headers, retries, and idle time consume capacity or time without completing additional user work. End-to-end measurements include dependencies that a narrow component test excludes. Both measurements can be valid, provided their scopes are clear.

Look beyond the mean

Suppose four response times are 1, 1, 1, and 9 seconds. Their arithmetic mean is three seconds, although no request actually took three seconds. The mean alone hides the very slow request. A median and upper percentiles can describe different parts of the distribution, but their calculation and sample size should be stated.

Small samples cannot characterize rare slow events reliably. A high percentile computed from a handful of requests can look precise while representing very little evidence. Preserve raw samples, repeat runs, and investigate outliers rather than automatically deleting them. A slow event may be a measurement problem or a real operational condition.

Measure against a purpose

An interactive experience may prioritize response latency, while an overnight batch may prioritize completed work before a deadline. A shared service often needs both: sufficient throughput at an acceptable latency distribution. Cost and reliability add further constraints.

Define the input, timing boundary, concurrency, duration, successful-completion rule, and error handling before comparing systems. Check that more throughput was not achieved by silently dropping work or weakening the accepted output. Continue with parallel computing for adding execution capacity and computational benchmark evidence for how to report a result clearly.