How to Test Proxy Speed and Reliability

A single fast response tells you how one proxy request performed. Repeat the same check under comparable conditions and track both response time and failures to see how the proxy behaves across requests.

Analog stopwatch on a shelf beneath a stack of rack servers

Pick a proxy speed test endpoint you control

Serve a small, fixed file over HTTPS on a host you operate, such as a 64 KiB check.txt at a dedicated test URL. Configure it to return HTTP 200 without a redirect, keep its contents constant and use the same caching policy for both routes. Read the file once to confirm that its size and content match what you expect. A stable fixture keeps a slow database query, a login redirect or a changing response size from distorting the comparison.

Run the measurement where the real client runs. A proxy that looks quick from a laptop may take longer from a CI runner in another region. Compare a baseline connection without an explicit proxy and a proxied connection from the same runner. Keep the target URL, expected status, timeout and request size the same. If your network requires a corporate proxy, follow its policy and use your approved baseline. Record the date, runner region and proxy type so you can repeat the test on the same terms.

A small fixture is suitable for response latency and basic reliability. To measure sustained download throughput, use a second fixed file of known size that takes long enough to download for the transfer phase to dominate. Test that file separately. Start by confirming the proxy route and public exit with an IP lookup in cURL.

Measure TTFB, total time and the HTTP result

cURL’s time_starttransfer is the elapsed time until it receives the first response byte. It includes connection setup and the server’s wait before sending data. For an HTTPS request through an HTTP proxy, that elapsed time can include reaching the proxy, establishing the CONNECT tunnel and negotiating TLS with the target. time_total covers the whole operation, including the response download. Both values are in seconds. On a completed response, subtracting TTFB from total time gives an estimate of the time spent after the first byte arrived. cURL write-out fields.

If TTFB rises on the proxy route and the time after the first byte stays similar, inspect setup and upstream waiting first. If TTFB holds steady while total time grows on the larger file, check transfer rate and confirm that both routes downloaded the same number of bytes. The measurements cover the full route. A gateway and a target in different regions can both contribute to the difference.

target='https://measure.example/check.txt'
proxy='http://gateway.example:8080'
format='%{http_code},%{http_connect},%{time_starttransfer},%{time_total}'

printf 'route,attempt,exit,status,connect_status,ttfb_s,total_s\n'
for attempt in $(seq 1 12); do
  for route in direct proxy; do
    if [ "$route" = direct ]; then
      args=(--noproxy '*')
    else
      args=(--noproxy '' --proxy "$proxy")
    fi

    if result=$(curl --disable "${args[@]}" --fail --silent --show-error \
        --connect-timeout 4 --max-time 10 --output /dev/null \
        --write-out "$format" "$target"); then
      exit_code=0
    else
      exit_code=$?
    fi

    printf '%s,%s,%s,%s\n' "$route" "$attempt" "$exit_code" "$result"
    sleep 1
  done
done

Replace both example addresses and use a proxy account you are allowed to test. The Bash example assumes an endpoint that uses source-IP authorization or needs no username and password. If authentication is required, use your approved secret setup and supply its options only on the proxy branch. Save the script as proxy-sample.sh and run bash proxy-sample.sh > proxy-timings.csv. The script alternates routes, waits after each request and starts a fresh cURL process for every sample. Reproduce the same settings before comparing runs. If your app keeps connections open, measure that workload separately and label it as a reused-connection test. How cURL reuses connections.

Calculate success rate, p50 and p95

For this fixture, count an attempt as successful when cURL finishes with exit code 0 and the target status is 200. Divide successes by all attempts on that route, including timeouts and HTTP errors. For example, nine successes in twelve attempts is 75%. To summarize latency for completed transfers, sort their times and report the 50th and 95th percentiles. This example uses the nearest-rank method. With at most twelve successful samples, the 95th percentile is the slowest of them.

import csv
from math import ceil

with open("proxy-timings.csv", newline="") as file:
    rows = list(csv.DictReader(file))

for route in ("direct", "proxy"):
    attempts = [row for row in rows if row["route"] == route]
    if not attempts:
        continue
    successes = [
        row for row in attempts
        if row["exit"] == "0" and row["status"] == "200"
    ]
    rate = 100 * len(successes) / len(attempts)
    print(f"{route}: {len(successes)}/{len(attempts)} successful ({rate:.1f}%)")
    if successes:
        for field in ("ttfb_s", "total_s"):
            times = sorted(float(row[field]) for row in successes)
            p50 = times[ceil(0.50 * len(times)) - 1]
            p95 = times[ceil(0.95 * len(times)) - 1]
            print(f"  {field}: p50={p50:.3f}s p95={p95:.3f}s")

Read the latency and success rate together. A route with a p50 of 250 ms and three timeouts can look faster on paper than a route with a p50 of 320 ms and no failures. The count of failures shows which requests fell outside the completed-transfer percentiles. If you have a service deadline, report how many of all attempts finish within that deadline as a separate measure. Repeat the small batch at different times for a better view of tail latency, and retain the sample count when you share the result.

Use the failure stage to find what slowed down

Before you rerun a disappointing batch, check the script’s time limits against the workload you actually care about. The four-second connection limit bounds setup. The ten-second total limit caps the transfer as a whole. If a timeout belongs in your application’s normal deadline, count it as a failure even if a longer test would finish. Keep automatic retries out of this initial measurement so each recorded attempt represents a single transfer. cURL connection time limit.

Keep the original rows. A CONNECT response of 407 concerns proxy authentication. A successful CONNECT followed by a target error puts the next check on the destination side. Exit code 28 means cURL reached a timeout. If both routes slow down together, check the test host or shared network before assigning the slowdown to the proxy. Use request timestamps to align the cURL results with your endpoint logs. A missing request in those logs narrows the next check to connection setup, the proxy or another hop before the origin. libcurl error reference.

When you share the results with a provider, include the proxy identifier, scheme, runner location, destination and connection status. Keep secret values out of the report. If the online tester and your local measurements differ, compare where each was run and what each probe measured. The online tester’s response time describes the request made from its own server. Read the response time and status columns.

All proxy testing guides · Open the proxy tester