Skip to content

add maglev load balancer #2434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 9, 2022

Conversation

ramaraochavali
Copy link
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
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
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
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
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
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
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
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

ericvn commented Aug 3, 2022

/test gencheck_api

Copy link
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
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
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
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
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>
// The minimum number of virtual nodes to use for the hash
// ring. Defaults to 1024. Larger ring sizes result in more granular
// 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 = 4;
uint64 minimum_ring_size = 4 [deprecated=true];
Copy link
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.

// The minimum number of virtual nodes to use for the hash
// ring. Defaults to 1024. Larger ring sizes result in more granular
// 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 = 4;
uint64 minimum_ring_size = 4 [deprecated=true];
Copy link
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
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
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
Contributor Author

@howardjohn @nmittler addressed comments. PTAL

@linsun
Copy link
Member

linsun commented Aug 5, 2022

should this have some type of release notes? Else LGTM

@ramaraochavali
Copy link
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
Contributor Author

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

Copy link

@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