Skip to content

[serve] hap grpc perf tuning - #63348

Merged
akyang-anyscale merged 4 commits into
ray-project:hap-ga-1from
akyang-anyscale:alexyang/hap-grpc-v2
May 19, 2026
Merged

akyang-anyscale merged 4 commits into
ray-project:hap-ga-1from
akyang-anyscale:alexyang/hap-grpc-v2

Conversation

@akyang-anyscale

@akyang-anyscale akyang-anyscale commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Make haproxy http2 tuning parameters adjustable via env var

Signed-off-by: akyang-anyscale <[email protected]>
Signed-off-by: akyang-anyscale <[email protected]>
Signed-off-by: akyang-anyscale <[email protected]>
@akyang-anyscale
akyang-anyscale changed the base branch from master to hap-ga-1 May 14, 2026 19:46
@akyang-anyscale akyang-anyscale added the go add ONLY when ready to merge, run all tests label May 14, 2026
@akyang-anyscale
akyang-anyscale marked this pull request as ready for review May 14, 2026 19:46
@akyang-anyscale
akyang-anyscale requested a review from a team as a code owner May 14, 2026 19:46

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements gRPC support for the HAProxy-based ingress in Ray Serve. Key changes include the addition of gRPC-specific configuration options, tuning flags for HTTP/2, and updated HAProxy templates to support gRPC frontends with header-based routing. The PR also introduces TCP-level health checks for gRPC backends and updates the test suite to reflect HAProxy's current lack of support for gRPC streaming. Review feedback highlights the need to explicitly enable health checks for gRPC and fallback servers in the HAProxy configuration and suggests ensuring the proxy's health status correctly incorporates gRPC backends in gRPC-only deployments.

I am having trouble creating individual review comments. Click here to see my feedback.

python/ray/serve/_private/haproxy_templates.py (294)

high

The server directive for gRPC backends is missing the check keyword. Without this, HAProxy will not perform health checks on the gRPC replicas and will always consider them UP, which prevents effective load balancing and failover if a replica becomes unreachable.

    server {{ server.name }} {{ server.host }}:{{ server.port }} proto h2 check

python/ray/serve/_private/haproxy_templates.py (297)

high

The fallback server for gRPC backends is also missing the check keyword, which prevents HAProxy from verifying its availability before attempting to route traffic to it.

    server {{ backend.fallback_server.name }} {{ backend.fallback_server.host }}:{{ backend.fallback_server.port }} proto h2 backup check

python/ray/serve/_private/haproxy.py (906)

medium

health_route_info is currently calculated using only http_backends. In a gRPC-only deployment, http_backends will be empty, which may cause the proxy to report itself as unhealthy via both HTTP and gRPC health check endpoints (since health_info.healthy will likely be false). It should use the full backends list to accurately reflect the proxy's health status regardless of the protocol used by the applications.

            health_route_info = self.cfg.build_health_route_info(backends)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 09611e4. Configure here.

Signed-off-by: akyang-anyscale <[email protected]>
@ray-gardener ray-gardener Bot added the serve Ray Serve Related Issue label May 15, 2026
@akyang-anyscale
akyang-anyscale merged commit ebd934e into ray-project:hap-ga-1 May 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray fails to serialize self-reference objects

2 participants