# Latency

Latency measures elapsed time between a defined start and response point, exposing the delays users experience while a system works.

- Type: metric
- Domain: Engineering & architecture
- Level: Foundational
- Last reviewed: 2026-10-19
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/latency/>)

## What it means

Latency is the time taken for an operation or response across a specified boundary. Network transit, server processing, queue waiting, and complete user interactions have different boundaries and should be named. It differs from throughput, which counts work per unit time, and bandwidth, which describes a communication link’s capacity.

## Why it matters

A system can process many requests while some users wait a long time. Latency distributions show whether slow experiences are concentrated in particular regions, endpoints, or operations that averages obscure.

## When to use it

Use it when defining response expectations or investigating slow tasks. Select a boundary relevant to the user and report percentiles and sample counts. Server timing alone is insufficient when network or browser work dominates the experience.

## How it works

1. Define the operation, start event, completion event, and measurement location.
2. Collect durations for representative traffic and separate success from failure.
3. Report the distribution, including relevant percentiles and traffic volume.
4. Segment by task, region, device, or dependency to locate delays.
5. Compare improvements with user-facing goals under comparable demand.

## A practical example

A search API averages 180 milliseconds but its p95 reaches two seconds for one region. The team checks regional traces rather than adding a global loading animation and finds an avoidable cross-region dependency.

## Where it breaks

Percentiles are estimates influenced by sampling and measurement windows; averaging percentiles from separate groups does not produce a valid combined percentile. Fast failures can make an overall average look better while service quality worsens. Synthetic timing may differ from real-user timing.

## Common mistakes

- Reporting only the average.
- Comparing server processing time with full browser response time.
- Combining successful and failed request timing without explaining the mix.

## Sources

1. [Monitoring Distributed Systems](<https://sre.google/sre-book/monitoring-distributed-systems/>) — Google SRE · Engineering handbook
2. [What is Latency?](<https://aws.amazon.com/what-is/latency/>) — Amazon Web Services · Technical guidance

## Related topics

- [Observability](<https://wiki.soroush.uk/topic/observability/>)
- [Service-Level Indicator](<https://wiki.soroush.uk/topic/service-level-indicator/>)
- [Timeout](<https://wiki.soroush.uk/topic/timeout/>)
