Latency: delay between request and response
Latency is the time it takes for data to travel from source to destination; for a website it is the delay between the browser sending a request and the response arriving. Network latency is usually measured as a round-trip time.
- Latency is delay. Bandwidth is capacity. A fast connection can still have high latency.
- A first request pays for DNS, TCP and TLS setup. Later requests reuse the connection.
- Distance matters, which is why CDNs and regional servers lower latency.
What phases make up request latency?
| Phase | What happens |
|---|---|
| Blocked | Waiting in a queue because too many connections are open to one server |
| DNS resolution | Looking up the IP address for the host name |
| Connecting | TCP handshake |
| TLS handshake | Setting up the secure connection |
| Sending / Waiting | Sending the request, then waiting for the server to process it |
| Receiving | Downloading the response, set by network capacity and file size |
Phases per MDN: Understanding latency.
What latency should you expect?
| Preset | Min. latency |
|---|---|
| Regular 2G | 300 ms |
| Good 3G | 40 ms |
| Regular 4G/LTE | 20 ms |
| DSL | 5 ms |
| Wi-Fi | 2 ms |
Track latency as a percentile
Google SRE recommends reporting latency as a high percentile, such as the 99th, and tracking failed requests separately from successful ones, because fast error responses can make an average look good.
Common questions
What is the difference between latency and bandwidth?
Latency is how long a single piece of data takes to arrive. Bandwidth is how much data can be moved per second. A satellite link can have high bandwidth and high latency, which makes page loads with many small requests feel slow.
What is good latency for a website?
Lower is better, and it depends on distance. Round trips on a local network are a few milliseconds, as the MDN throttling presets show. For page performance, look at TTFB and Core Web Vitals rather than one latency number.
How do you reduce latency?
Serve content from locations closer to visitors with a CDN, reuse connections, reduce the number of separate hostnames and requests, and speed up server processing. Each removes one of the phases listed above or shortens the distance.
Keep reading
Watch your domains automatically
Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.