Skip to content

Implement power of 2 choices LB for cc=0#8226

Merged
knative-prow-robot merged 2 commits intoknative:masterfrom
vagababov:20200605-lb-policy2
Jun 6, 2020
Merged

Implement power of 2 choices LB for cc=0#8226
knative-prow-robot merged 2 commits intoknative:masterfrom
vagababov:20200605-lb-policy2

Conversation

@vagababov
Copy link
Contributor

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

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 6, 2020
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/autoscale area/networking labels Jun 6, 2020
@knative-prow-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 6, 2020
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/activator/net/lb_policy.go 100.0% 95.2% -4.8
pkg/activator/net/throttler.go 91.3% 91.4% 0.1

Copy link
Contributor

@julz julz left a comment

Choose a reason for hiding this comment

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

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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeps, sgtm

Copy link
Contributor

Choose a reason for hiding this comment

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

(early not late! :D)

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2020
@knative-prow-robot knative-prow-robot merged commit 6e6e43c into knative:master Jun 6, 2020
@vagababov vagababov deleted the 20200605-lb-policy2 branch June 23, 2020 23:17
@julz julz mentioned this pull request Jul 23, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/autoscale area/networking cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants