Ping and latency

Latency (ping) is the time it takes a request to reach a server and a response to come back, measured in milliseconds.

Updated · Prokso editorial team

Through a proxy, a request travels a longer path: from you to the gateway, from the gateway to the exit address, from there to the site and back. Each leg adds its own milliseconds.

Latency depends on distance and the address type. Datacenter proxies respond faster, residential and mobile ones more slowly, because the request goes through a home device or a phone.

If speed matters, choose a country close to the website, not to yourself: a site in Germany will respond faster through a proxy in Germany than through another continent.

The response time of a specific proxy is shown by the proxy checker. A related setting is the timeout.

Where the time of one HTTPS request goes

The first request through a proxy makes several round trips: connecting to the gateway, the CONNECT exchange during which the gateway reaches the site through the exit address, the TLS handshake with the site and finally the request itself. Each step waits for an answer, so latency adds up rather than happening once. If the next request goes through the same open connection, only the last step remains.

That is why keep-alive matters with proxies: reusing a connection saves the handshakes. Programs that open a new connection for every request pay the full price each time. Browsers keep connections open on their own, while in scripts you should use a session, for example requests.Session() in Python.

How to measure each stage with curl

Add timing variables to the command: curl -s -o /dev/null -w "%{time_connect} %{time_appconnect} %{time_starttransfer} %{time_total}\n" -x http://LOGIN:PASSWORD@gw.prokso.com:823 https://example.com. All values are counted in seconds from the start of the request. A single measurement says little, so compare the average of several requests made at the same time.

VariableUp to which moment
time_connectthe TCP connection to the proxy is open
time_appconnectthe tunnel and the TLS handshake with the site are complete
time_starttransferthe first byte of the response has arrived
time_totalthe whole response has been received

Latency and speed are different things

Latency is how long you wait for the first byte, and speed is how fast a large response downloads. For small API requests or page checks, latency matters more than speed. If time_starttransfer is high and the gap to time_total is small, look at the distance to the site and the address type: datacenter proxies usually answer faster than residential and mobile ones.

FAQ

Why is a mobile proxy slower than a datacenter one?

The request goes through a phone or modem on a mobile network, while a datacenter proxy uses a datacenter connection.

How can I reduce latency?

Choose a proxy country near the website and an address type that suits the task: for fast work with public data, datacenter proxies.

Residential $1.59, mobile $2.50, datacenter $0.65 per GB

Sign up in a minute, get access right after payment.

Create account