Repository navigation
[serve] hap grpc perf tuning - #63348
Conversation
Signed-off-by: akyang-anyscale <[email protected]>
Signed-off-by: akyang-anyscale <[email protected]>
Signed-off-by: akyang-anyscale <[email protected]>
There was a problem hiding this comment.
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)
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)
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)
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)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 09611e4. Configure here.
Signed-off-by: akyang-anyscale <[email protected]>

Make haproxy http2 tuning parameters adjustable via env var