Skip to content

add maglev load balancer#2434

Merged
istio-testing merged 6 commits intoistio:masterfrom
ramaraochavali:fix/add_maglev_support
Aug 9, 2022
Merged

add maglev load balancer#2434
istio-testing merged 6 commits intoistio:masterfrom
ramaraochavali:fix/add_maglev_support

Conversation

@ramaraochavali
Copy link
Copy Markdown
Contributor

As discussed istio/istio#40142 adding support for MagLev loadbalancer.

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 30, 2022
@ramaraochavali ramaraochavali added the release-notes-none Indicates a PR that does not require release notes. label Jul 30, 2022
@ramaraochavali
Copy link
Copy Markdown
Contributor Author

/test release-notes_api

// considerations on choosing an algorithm.
oneof hash_algorithm {
// The ring/modulo hash load balancer implements consistent hashing to backend hosts.
RingHashConfig ring_hash = 6;
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.

should we deprecate the minimum_ring_size on L626?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. We can deprecate. Is it just doc update or any thing else?

// Please refer to https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancers#ring-hash
// and https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancers#maglev for
// considerations on choosing an algorithm.
oneof hash_algorithm {
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.

What is the default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Default is RingHash. I will update.

// The ring/modulo hash load balancer implements consistent hashing to backend hosts.
RingHashConfig ring_hash = 6;
// The Maglev load balancer implements consistent hashing to backend hosts.
MagLevConfig maglev = 7;
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 can set maglev without configuring the ring size? If so, how?

maglev: {}

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes. you can set maglev:{} and it uses the default table size.

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@ericvn
Copy link
Copy Markdown

ericvn commented Aug 3, 2022

/test gencheck_api

Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

LGTM, just two nits

cc @nmittler

// load distributions. If the number of hosts in the load balancing
// pool is larger than the ring size, each host will be assigned a
// single virtual node.
uint64 minimum_ring_size = 8 [deprecated=true];
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.

why is this one deprecated? isn't this the new one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah.. copy pasted at wrong place

// The table size for Maglev hashing. This helps in controlling the
// disruption when the backend hosts change.
// Increasing the table size reduces the amount of disruption.
uint64 table_size = 9;
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.

Suggested change
uint64 table_size = 9;
uint64 table_size = 1;

new message, new number scheme (I think? or does nesting change it?). Same above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No you are right. This has to be follow new number

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
// pool is larger than the ring size, each host will be assigned a
// single virtual node.
uint64 minimum_ring_size = 4;
uint64 minimum_ring_size = 4 [deprecated=true];
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.

Replace the comment with text indicating that it's deprecated and where to find the replacement value.

// pool is larger than the ring size, each host will be assigned a
// single virtual node.
uint64 minimum_ring_size = 4;
uint64 minimum_ring_size = 4 [deprecated=true];
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.

same comment here.

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Comment on lines +611 to +613
// Please refer to https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancers#ring-hash
// and https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancers#maglev for
// considerations on choosing an algorithm.
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.

We should give a brief compare here, rather than letting users searching and decide

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it is difficult to give concise description in a protobuf comment. That is why Envoy wrote that separate section.

@ramaraochavali
Copy link
Copy Markdown
Contributor Author

@howardjohn @nmittler addressed comments. PTAL

@linsun
Copy link
Copy Markdown
Member

linsun commented Aug 5, 2022

should this have some type of release notes? Else LGTM

@ramaraochavali
Copy link
Copy Markdown
Contributor Author

should this have some type of release notes? Else LGTM

I will add release notes when it is implemented in Istio.

@ramaraochavali
Copy link
Copy Markdown
Contributor Author

@linsun @howardjohn can you please review this when you get chance?

Copy link
Copy Markdown

@ericvn ericvn left a comment

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes-none Indicates a PR that does not require release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants