Latency
One-way or round-trip delay. Propagation, transmission, queueing, processing.
Level: beginner
What is it?
Network latency is the time required for data or a request to travel between points. It may be measured one-way or as a round-trip time, and it includes propagation, transmission, processing, and queueing delays.
Why does it matter?
Latency strongly affects interactive APIs, remote terminals, gaming, and distributed transactions. A high-bandwidth link cannot make propagation or protocol round trips disappear.
Mental model
Split total delay into components: serialization time to put bits onto a link, propagation time for the signal to travel, processing time at devices, and queueing time waiting behind other traffic.
How it works
- Propagation delay depends on physical distance and signal speed in the medium.
- Transmission/serialization delay depends on packet size and link rate.
- Queueing delay grows under contention and may dominate under congestion.
- Round-trip time includes the forward and return paths, which may not be symmetric.
- Application protocols that require multiple sequential round trips can multiply user-visible latency.
Steps
- Measure a baseline RTT to separate network delay from application processing time as far as tools allow.
- Check packet size, path distance, loss, and queueing metrics.
- Trace how many sequential request-response exchanges the application requires.
- Reduce unnecessary round trips or place compute/data closer when the workload justifies it.
Real-world usage
- Profiling interactive applications and database calls across regions.
- Comparing bandwidth improvements with protocol and geographic improvements.
- Diagnosing queueing spikes and tail latency.
Common mistakes
- Confusing RTT with one-way latency.
- Assuming low ping guarantees high application throughput.
- Ignoring p95/p99 latency when averages look healthy.
Interview questions
What are the main latency components?
Propagation, transmission, processing, and queueing delay.
How does a chatty protocol increase latency?
Sequential request-response exchanges add repeated RTTs; reducing round trips or combining requests can reduce overall completion time.