Repository navigation
[serve][release] Add HAProxy variant to throughput-optimized serve microbenchmarks - #63386
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new test variation, aws.haproxy, to the release/release_tests.yaml configuration. This variation defines a BYOD cluster environment with specific Ray Serve settings, including throughput optimization, a reduced draining period, increased gRPC message length, and the enablement of HAProxy. There are no review comments to address, and I have no feedback to provide.
|
does this pass? i tried this before but grpc is not implemented so the release test always fails |
Release benchmark runsRun A v2:
|
Benchmark results: HAProxy vs baseline (Python
|
| Metric | Baseline | HAProxy | Δ |
|---|---|---|---|
http_10mb_p50_latency |
2.87 ms | 4.71 ms | +64.0% |
http_10mb_p90_latency |
2.97 ms | 5.05 ms | +70.2% |
http_10mb_p95_latency |
3.01 ms | 5.84 ms | +94.2% |
http_10mb_p99_latency |
4.31 ms | 8.39 ms | +94.6% |
http_1mb_p90_latency |
0.88 ms | 1.48 ms | +67.5% |
http_1mb_p99_latency |
0.98 ms | 1.57 ms | +59.3% |
http_p99_latency (small) |
0.88 ms | 0.94 ms | +7.1% |
http_streaming_p99_latency |
10.64 s | 10.91 s | +2.6% |
http_streaming_avg_tps |
47 392 | 46 509 | −1.9% |
http_streaming_throughput_std |
249.3 | 480.3 | +92.6% |
http_intermediate_streaming_throughput_std |
82.0 | 272.4 | +232% |
handle_* (in-process; no proxy hop) |
— | — | ±0.5–8% (noise band) |
Reading
- HAProxy adds a measurable HTTP hop cost. Small-payload p99 +7%; 1 MB p99 +59%; 10 MB p99 nearly 2×. Expected: requests now traverse client → HAProxy → replica instead of client → replica directly.
- Streaming under HAProxy is ~2-3% slower on mean latency and ~2% lower on tps, and the throughput becomes noticeably more variable (std-dev roughly doubles for streaming, +232% for
intermediate_streaming). Mirrors the directional finding from PR [serve] Default RAY_SERVE_HAPROXY_TCP_NODELAY to 1 #63353. handle_*metrics shift within roughly ±5–8% despite the handle path not touching the proxy at all. Take those as noise floor / cluster variance, not a real HAProxy effect.- gRPC metrics are intentionally absent from the haproxy run. The variant's
script:override drops--run-grpcbecause HAProxy is HTTP-only and doesn't proxygRPCOptions(port=9000); before this fix the variant crashed at the first gRPC call. Comparison vs baseline is therefore HTTP/handle/streaming-only by design.
What this PR is worth merging for
It surfaces all of the above as a regression-trackable signal in the nightly. Today none of the request-path microbenchmark variants exercise HAProxy at all — so any regression in the HAProxy proxy code path (or in shared tunables like RAY_SERVE_HAPROXY_TCP_NODELAY) would not show up.
🤖 Generated with Claude Code
…crobenchmarks Adds a `.aws.haproxy` variation to `pytest_serve_throughput_optimized_microbenchmarks` so the nightly throughput-optimized signal exercises the HAProxy proxy in addition to the default Python ProxyActor. Mirrors the existing `.aws.haproxy` pattern used on other serve release tests. Without this, none of the nightly request-path microbenchmark coverage runs against HAProxy, so latency/throughput regressions specific to the HAProxy code path (or to its tunables like RAY_SERVE_HAPROXY_TCP_NODELAY) do not surface in the nightly signal. Signed-off-by: Kourosh Hakhamaneshi <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: akyang-anyscale <[email protected]>
HAProxy is HTTP-only and does not proxy the gRPC server that `pytest_serve_throughput_optimized_microbenchmarks --run-all` binds via `gRPCOptions(port=9000, ...)`. Under `RAY_SERVE_ENABLE_HA_PROXY=1`, the gRPC client connection to `127.0.0.1:9000` is refused as soon as `--run-all` finishes the HTTP phases and transitions into the gRPC suite, and the workload crashes: grpc._channel._InactiveRpcError: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:9000: Failed to connect to remote host: connect: Connection refused (111)" Override `run.script` on the `.aws.haproxy` variation to invoke the explicit transport flags (`--run-http --run-handle --run-latency --run-throughput --run-streaming`) so only the HAProxy-proxied transports are exercised. The plain `.aws` variant is unchanged and continues to run `--run-all`. Signed-off-by: Kourosh Hakhamaneshi <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: akyang-anyscale <[email protected]>
Adds RAY_SERVE_LLM_ENABLE_DIRECT_STREAMING=1 to the haproxy variant's runtime_env and --run-direct-streaming to the command line, so the nightly haproxy row exercises the optimal-latency configuration end to end: HAProxy + TCP_NODELAY=1 (default in ray-project#63353) + THROUGHPUT_OPTIMIZED=1 + direct streaming via ingress_request_router bypass. Depends on ray-project#63391, which defines --run-direct-streaming and DirectStreamingRouter. Without ray-project#63391 merged, this command line will fail at click parse time. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: akyang-anyscale <[email protected]>
14b681c to
47fe772
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Reviewed by Cursor Bugbot for commit 47fe772. Configure here.
Signed-off-by: akyang-anyscale <[email protected]>
Signed-off-by: akyang-anyscale <[email protected]>
|
benchmarks:
|
…crobenchmarks (ray-project#63386) Signed-off-by: Kourosh Hakhamaneshi <[email protected]> Signed-off-by: akyang-anyscale <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Co-authored-by: akyang-anyscale <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
…crobenchmarks (ray-project#63386) Signed-off-by: Kourosh Hakhamaneshi <[email protected]> Signed-off-by: akyang-anyscale <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Co-authored-by: akyang-anyscale <[email protected]> Signed-off-by: 400Ping <[email protected]>
…ptimized variant (#66771) ## Description The `aws.haproxy` variant of `pytest_serve_throughput_optimized_microbenchmarks` overrode the script to skip `--run-grpc`, because HAProxy did not proxy gRPC when the variant was added (#63386). HAProxy has proxied gRPC since #63735, so this PR removes the override. The variant now inherits the base `--run-all` script and runs the gRPC latency and throughput benchmarks the same way the non-HAProxy variant does. **Latency** | Scenario | p50 | p90 | p95 | p99 | |---|---:|---:|---:|---:| | http | 0.808204 | 0.861002 | 0.884248 | 0.965185 | | http_1mb | 0.916350 | 0.960832 | 0.979879 | 1.035858 | | http_10mb | 2.923250 | 3.028106 | 3.064171 | 3.147383 | | http_streaming | 10606.518767 | 10727.092702 | 10782.166075 | 10793.441756 | | http_intermediate_streaming | 11520.631168 | 11709.328922 | 11783.598146 | 11794.278803 | | grpc | 0.329592 | 0.359457 | 0.374129 | 0.419050 | | grpc_1mb | 2.914066 | 3.262638 | 3.301536 | 3.536366 | | grpc_10mb | 28.468160 | 29.396314 | 29.621062 | 33.389895 | | handle | 0.496363 | 0.535661 | 0.563960 | 0.684138 | | handle_1mb | 1.240247 | 1.785575 | 2.186740 | 2.772050 | | handle_10mb | 20.357473 | 24.710342 | 26.734965 | 34.078222 | | handle_choose_dispatch | 1.365623 | 1.479252 | 1.537067 | 1.765258 | | handle_streaming | 11385.084532 | 11440.792105 | 11521.717464 | 11530.988577 | **Throughput** | Scenario | Average | Standard deviation | Rate | |---|---:|---:|---| | http | 3170.64 | 71.61 | RPS | | http_model_comp | 1532.82 | 10.25 | RPS | | http_100_max_ongoing_requests | 3179.71 | 73.90 | RPS | | http_model_comp_100_max_ongoing_requests | 1849.08 | 23.66 | RPS | | http_800_max_ongoing_requests | 2445.74 | 54.76 | RPS | | http_model_comp_800_max_ongoing_requests | 1567.39 | 22.87 | RPS | | http_streaming | 46990.46 | 436.22 | TPS | | http_intermediate_streaming | 12994.40 | 152.01 | TPS | | grpc | 4476.50 | 40.00 | RPS | | grpc_model_comp | 1791.69 | 11.26 | RPS | | grpc_100_max_ongoing_requests | 4498.49 | 41.80 | RPS | | grpc_model_comp_100_max_ongoing_requests | 1840.62 | 11.83 | RPS | | grpc_800_max_ongoing_requests | 4622.03 | 58.40 | RPS | | grpc_model_comp_800_max_ongoing_requests | 1841.71 | 18.64 | RPS | | handle | 3504.46 | 46.10 | RPS | | handle_model_comp | 1020.17 | 25.20 | RPS | | handle_100_max_ongoing_requests | 3539.55 | 41.45 | RPS | | handle_model_comp_100_max_ongoing_requests | 1691.89 | 9.40 | RPS | | handle_800_max_ongoing_requests | 3470.64 | 44.36 | RPS | | handle_model_comp_800_max_ongoing_requests | 1633.69 | 10.54 | RPS | | handle_streaming | 13147.51 | 57.50 | TPS | Signed-off-by: akyang-anyscale <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

Summary
Adds a
.aws.haproxyvariation topytest_serve_throughput_optimized_microbenchmarksinrelease/release_tests.yamlso the nightly throughput-optimized microbenchmark signal exercises the HAProxy proxy in addition to the default PythonProxyActor.Motivation
Today none of the request-path microbenchmark variants under
pytest_serve_*microbenchmarkssetRAY_SERVE_ENABLE_HA_PROXY=1, so the nightly benchmark numbers only reflect the Python proxy path. That means latency / throughput regressions specific to the HAProxy code path — or to its tunables likeRAY_SERVE_HAPROXY_TCP_NODELAY(recently flipped on by default in #63353) — do not surface in the nightly signal.The new
aws.haproxyvariation re-uses the same single-node 16-CPU compute and the same--run-allinvocation, just togglingRAY_SERVE_ENABLE_HA_PROXY=1inruntime_env. Existing throughput-optimized env vars are preserved in the variation'sruntime_env(variation env lists replace rather than merge, mirroring the pattern inserve_controller_benchmark_haproxy.aws.pip_haproxy).Test plan
.aws.haproxyvariations onpytest_serve_scale_replicas,pytest_serve_multi_deployment_1k_noop_replica,pytest_serve_autoscaling_load_test, andpytest_serve_resnet_benchmark.serve_controller_benchmark_haproxy.aws.pip_haproxy(variants replace, not merge).pytest_serve_throughput_optimized_microbenchmarks.aws.haproxyresults; a one-off manual trigger from the BK release pipeline before merge can confirm the run wires up cleanly.🤖 Generated with Claude Code