You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None of the built-in policies route by observed latency. A backend that is slow but not failing
(GC pauses, a noisy neighbour, CPU throttling, a cold cache) keeps a full share of traffic, and
tail latency goes up for every caller:
round_robin and pick_first ignore backend performance.
least_request_experimental balances outstanding requests only, so it can't tell a slow backend
from a busy one.
weighted_round_robin needs servers to report ORCA load, which many deployments don't.
outlier_detection reacts to failures, not slowness.
Describe the solution you'd like
A peak_ewma_experimental policy, using the algorithm from Finagle and Linkerd/tower that Envoy
now ships as a contrib load balancer
(envoy.extensions.load_balancing_policies.peak_ewma.v3alpha.PeakEwma):
Per endpoint, keep a "peak" EWMA of client-observed RTT. It jumps up immediately on a slow
response and decays over a configurable time, including while the endpoint isn't being picked,
so it gets probed again and can recover.
cost = peak_rtt × (outstanding_requests + 1)
Per pick, sample choiceCount (default 2) READY endpoints and take the cheapest.
It would be structured like least_request (endpoint-level pick_first children, A61), with no
ejection of its own; users who want ejection wrap it in outlier_detection. Config is three
fields: choiceCount, decayTime, defaultRtt. It needs nothing from the server.
I'd write the gRFC and the Java implementation, following the A48 (least_request) precedent.
Describe alternatives you've considered
least_request + outlier_detection: good for failures, but a uniformly slower backend
isn't failing, so it keeps a large share (numbers below).
weighted_round_robin with ORCA: more accurate where it's available, but it needs server
cooperation. It doesn't help with third-party or legacy servers.
Keeping it as an external library: this is what I do today
(https://github.com/ParkerHarrelson/grpc-peak-ewma-lb). It works, but latency-aware balancing is
a common need, and a built-in policy would be usable from service config and xDS without an
extra dependency.
Extending least_request with a latency mode: possible, but the cost function differs, and a
separate policy maps cleanly onto Envoy's separate extension.
Additional context
I load-tested my standalone implementation against round_robin and outlier_detection_experimental(least_request_experimental): 20 backends, one JVM per pod, real
gRPC over TCP, on a single machine (not yet a real cluster):
Client CPU per RPC was within noise of round_robin at 10 and 50 backends. The tested
implementation is a superset of what's proposed here (it adds per-method scoring and adaptive
decay); I'd re-run the tests with the minimal policy for the gRFC.
Before I write the gRFC:
Would the team consider this as an all-languages gRFC?
Should it map to Envoy's peak_ewma proto via A52, even though that proto is contrib/v3alpha?
Or should it start as service-config only?
Is it acceptable to count only unary RPCs as RTT samples and outstanding load? A long-lived
stream's duration isn't a latency. My concern is that other languages may not expose the method
type at pick time.
Thanks for the detailed initial POC and the testing you've done so far!
Hi @markdroth, pulling you into this thread as we brought this up in the grpc-java team meeting and felt your expertise would be perfect here. Could you review the proposal and let us know your thoughts.
CC: @ejona86@kannanjgithub
Activity
shivaspeaks commentedon Oct 13, 2026
Thanks for the detailed initial POC and the testing you've done so far!
Hi @markdroth, pulling you into this thread as we brought this up in the grpc-java team meeting and felt your expertise would be perfect here. Could you review the proposal and let us know your thoughts.
CC: @ejona86 @kannanjgithub
ParkerHarrelson commentedon Oct 19, 2026
Hey @shivaspeaks, just got back from vacation and saw your comment. Was wondering if you have heard anything regarding interest here?