Skip to content

romkatv/hcproxy-bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hcproxy-bench

A benchmark for HTTP CONNECT proxies. Built for hcproxy but works with other forward proxies too. See benchmark results comparing hcproxy with fpgo.

How it works

  1. Starts a TCP echo server on localhost:server-port that reads request-bytes and writes response-bytes in a loop.
  2. Opens connections TCP connections to the proxy at localhost:proxy-port.
  3. Sends CONNECT localhost:server-port HTTP/1.1 through each connection to establish tunnels.
  4. 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).
  5. Reports measurements.

Connection setup time is not included in the measurements.

Usage

dotnet run -c Release -- \
  --proxy-port=8889      \
  --server-port=8888     \
  --connections=2        \
  --request-bytes=128    \
  --response-bytes=2048  \
  --duration-seconds=10  \
  --histogram-buckets=32

Output

Responses:    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.

Requirements

  • .NET 6.0 or later. You may need to edit TargetFramework in the .csproj file to match your installed version.
  • No third-party dependencies

About

A benchmark for HTTP CONNECT proxies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages