Skip to content

lb: locality weighted LB.#565

Merged
htuch merged 5 commits intoenvoyproxy:masterfrom
htuch:locality-weighted-lb
Mar 22, 2018
Merged

lb: locality weighted LB.#565
htuch merged 5 commits intoenvoyproxy:masterfrom
htuch:locality-weighted-lb

Conversation

@htuch
Copy link
Copy Markdown
Member

@htuch htuch commented Mar 19, 2018

Introduce the concept of locality weighted LB (as distinct from zone
aware LB) in the docs and a new field in Cluster, locality_weighted_lb,
for configuring this behavior.

Signed-off-by: Harvey Tuch htuch@google.com

Introduce the concept of locality weighted LB (as distinct from zone
aware LB) in the docs and a new field in Cluster, locality_weighted_lb,
for configuring this behavior.

DO NOT SUBMIT until we have the corresponding implementation side
merged (1.6.0 release freeze week).

Signed-off-by: Harvey Tuch <htuch@google.com>
@htuch
Copy link
Copy Markdown
Member Author

htuch commented Mar 19, 2018

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

In general LGTM. Mainly would like to clarify relation of this and priority failover per our offline convo.

and adjust the management server assigned weights based on this. For example,
if locality X is weighted 60%, locality Y at 20% and locality Z at 20%, but
only half of locality Z's endpoints are healthy, we would weight X/Y/Z as
67%/22%/11%.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a bit unclear to me how health comes into weighting. Can you spell out the math for the reader? I think that would help.

Also, per our offline convo with @alyssawilk, how can we potentially have this same algorithm be used for priority failover selection? I think it would be really nice to have the same heuristics/algorithms used (possibly tunable in the future).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

P.S., I would model the docs after @alyssawilk amazing docs on priority failover: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/load_balancing#priority-levels (and really again related because IMO the algorithm should basically be the same, at least logically, possibly with different knobs).

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.

Your call, but I found on the loadbalancing PRs that doing the code and docs in parallel made sense, as I coded things up as a combination of how I wanted them and how Envoy affected our internal LB, and it resulted in much less doc thrashing :-P

// <arch_overview_load_balancing_locality_weighted_lb>` is used. Locality weight at
// a given priority level is computed from a combination of EDS assigned
// locality weight and known health status of the endpoints within a
// locality. For example, if locality X is weighted 60%, locality Y at 20%
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: probably not needed to repeat the math example, specially if the arch overview gets longer / more detailed. Up to you. Same below.

// locality. For example, if locality X is weighted 60%, locality Y at 20%
// and locality Z at 20%, but only half of locality Z's endpoints are
// healthy, we would weight X/Y/Z as 67%/22%/11%.
bool locality_weighted_lb = 2;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this needs to be enum. There could be different locality weighted algorithms that would require to reinterpret weights differently.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I might even just make this an empty message within a oneof to give us complete config flexibility later (I could imagine the knobs for tuning percentage multipliers, etc. could be tweaked).

htuch added 4 commits March 20, 2018 14:53
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM. Can you also have @amb67 or @alyssawilk take a look?

@htuch htuch merged commit c27ffa5 into envoyproxy:master Mar 22, 2018
@htuch htuch deleted the locality-weighted-lb branch March 22, 2018 17:06
htuch added a commit to htuch/envoy that referenced this pull request Mar 28, 2018
Risk Level: Low (only enabled when explicitly configured).
Testing: Unit tests for EDS, LoadBalancerImpl and UpstreamImpl. The load stats integration test
provides end-to-end validation.
Docs Changes: envoyproxy/data-plane-api#565
Release Notes:

Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added a commit to envoyproxy/envoy that referenced this pull request Mar 30, 2018
Underlying issue: #2725

Risk Level: Low (only enabled when explicitly configured).
Testing: Unit tests for EDS, LoadBalancerImpl and UpstreamImpl. The load stats integration test
provides end-to-end validation.
Docs Changes: envoyproxy/data-plane-api#565
Release Notes:

Signed-off-by: Harvey Tuch <htuch@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants