Skip to content
EN
Get Started

Latency

Latency is the delay between sending data and receiving a response, usually measured in milliseconds. Lower latency makes network requests feel more responsive.

Table of Contents (8 sections)

How latency is measured

Network latency can mean one-way delay, but round-trip time (RTT) is easier to measure. RTT covers the trip from your device to a destination and back. Web tools also measure connection time, time to first byte (TTFB) and total response time.

This curl command shows cumulative timing milestones in seconds:

curl -o /dev/null -s -w 'connect=%{time_connect} ttfb=%{time_starttransfer} total=%{time_total}' https://example.com

These values aren’t pure network latency. They also include steps such as name resolution, connection setup and server processing.

What adds latency

  • Distance and routing: Signals take time to travel. A longer or indirect network path usually adds delay.
  • Connection setup: A DNS lookup, TCP handshake and TLS handshake may happen before the request is sent.
  • Congestion and packet loss: Busy links create queues. Lost packets may need retransmission, which increases RTT.
  • Endpoint processing: A proxy server or website may take time to inspect, forward or generate a response. High TTFB doesn’t always mean the network itself is slow.

Latency vs bandwidth

Metric What it measures Common unit
Latency Delay for a trip Milliseconds
Bandwidth Transfer capacity Mbps or Gbps
Response time Full request duration Milliseconds or seconds

Bandwidth and latency are independent. A high-bandwidth connection can still pause before each response. Bandwidth matters more for large transfers, while latency often has a bigger effect on jobs that make many small requests.

Latency and proxies

A forward proxy changes the request path from client → website to client → proxy → website. That extra hop usually adds some delay, but the amount depends on distance, routing, load and the target server.

To diagnose proxy latency:

  1. Compare the same URL. Measure direct and proxied requests from the same client when direct access is permitted.
  2. Match the exit location to the task. An exit near the target server often reduces travel time, unless your test requires another location.
  3. Reuse connections. HTTP keep-alive and connection pools avoid repeating setup for every request.
  4. Track percentiles. Median and p95 timings reveal occasional slow requests that an average can hide. Set a connection timeout above normal variation and use capped retries with backoff.

FAQ

How much proxy latency is good?

It depends on the target, exit location and workload. Compare the proxy against a direct baseline and watch stable median and p95 values rather than relying on one universal cutoff.

Does a proxy always increase latency?

Usually, because it adds another network segment and processing step. A proxy route can occasionally be comparable to or faster than the direct route if network routing differs.

Is latency the same as ping?

No. Ping usually measures ICMP round-trip time. An HTTP request also includes DNS, connection setup, encryption, proxy processing and the website’s response time.

Related Terms

View All Terms