Implement power of 2 choices LB for cc=0#8226
Implement power of 2 choices LB for cc=0#8226knative-prow-robot merged 2 commits intoknative:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vagababov The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
The following is the coverage report on the affected files.
|
julz
left a comment
There was a problem hiding this comment.
Love it! This is super super cool. Really like how neat the new load balancer interface made the change \o/
/lgtm
| // otherwise pick 2 random unequal integers. | ||
| if l > 2 { | ||
| r1, r2 = rand.Intn(l), rand.Intn(l) | ||
| for r1 == r2 { |
There was a problem hiding this comment.
could probably skip the loop here by not including r1 in the choices for the second pick (ie rand(l), rand(l-1)). Seems fine to do this as a follow-on optimisation tho.
There was a problem hiding this comment.
You're up late :-)
I want to run this on the official benchmarks to see how it goes. We can try RR next (some variation thereof — least loaded RR).
But yeah we can probably squeeze a bit more from this, but it's gonna be nanoseconds.
For #7664
This does the power of 2 choices LB policy for CC=0.
Running benchmarks showed practically identical latency (~1ms improvement, depending on the run), but significant improvement in the StdDev (>40% smaller) and slight improvement in MAD.
/assign @yanweiguo @julz
/cc mattmoor