A benchmark for HTTP CONNECT proxies. Built for hcproxy but works with other forward proxies too. See benchmark results comparing hcproxy with fpgo.
- Starts a TCP echo server on
localhost:server-portthat readsrequest-bytesand writesresponse-bytesin a loop. - Opens
connectionsTCP connections to the proxy atlocalhost:proxy-port. - Sends
CONNECT localhost:server-port HTTP/1.1through each connection to establish tunnels. - Starts a timer and sends requests through all connections as fast as possible for
duration-seconds. Each connection sends requests sequentially (waits for response before sending next request). - Reports measurements.
Connection setup time is not included in the measurements.
dotnet run -c Release -- \
--proxy-port=8889 \
--server-port=8888 \
--connections=2 \
--request-bytes=128 \
--response-bytes=2048 \
--duration-seconds=10 \
--histogram-buckets=32Responses: 1120135
RPS: 11201.29
Avg (ms): 0.178
P50 (ms): [0.131, 0.262)
P90 (ms): [0.131, 0.262)
P99 (ms): [0.262, 0.524)
Histogram:
[0.066, 0.131) ms: 11152
[0.131, 0.262) ms: 1020028
[0.262, 0.524) ms: 84867
[0.524, 1.049) ms: 3115
[1.049, 2.097) ms: 917
[2.097, 4.194) ms: 54
[4.194, 8.389) ms: 2
- Responses: Total number of completed request/response cycles.
- RPS: Responses per second across all connections.
- Avg: Average round-trip time (send request + receive response).
- P50/P90/P99: Percentile latencies as ranges. The actual latency fell within the given half-open interval.
- Histogram: Distribution of latencies across power-of-2 buckets.
- .NET 6.0 or later. You may need to edit
TargetFrameworkin the.csprojfile to match your installed version. - No third-party dependencies