Skip to content
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

HRW Hash Load Balancing #15596

Open
Agent-Tao opened this issue Mar 22, 2021 · 7 comments
Open

HRW Hash Load Balancing #15596

Agent-Tao opened this issue Mar 22, 2021 · 7 comments
Labels
area/load balancing design proposal Needs design doc/proposal before implementation enhancement Feature requests. Not bugs or questions. help wanted Needs help!

Comments

@Agent-Tao
Copy link
Contributor

HRW Hash Load Balancing

(Highest Random Weight, HRW) hashing, an alternative to the ring based, consistent hashing, allows clients to achieve distributed agreement on which node (or proxy) a given key is to be placed in.

this hash has two advantages

1、Load balancing: Since the hash function is randomizing, each of the n nodes is equally likely to receive the key K. Loads are uniform across the sites.

2、High hit rate: Since all clients agree on placing an key K into the same node N , each fetch or placement of K into N yields the maximum utility in terms of hit rate. The key K will always be found unless it is evicted by some replacement algorithm at N.

how about adding HRW hash to envoy ?

https://en.wikipedia.org/wiki/Rendezvous_hashing

@Agent-Tao Agent-Tao added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Mar 22, 2021
@snowp
Copy link
Contributor

snowp commented Mar 22, 2021

I think we would be amendable to adding this as a cluster or lb extension (doesn't exist yet, but I believe someone might be working on it) if someone is able to pick up the work.

@snowp snowp added area/load balancing design proposal Needs design doc/proposal before implementation help wanted Needs help! and removed triage Issue requires triage labels Mar 22, 2021
@Agent-Tao
Copy link
Contributor Author

so how about adding this hrw hash to lb policy? to be specific,
in cluster.proto, add HrwHash to LbPolicy:
enum LbPolicy {
HRW_HASH = 8;
}

and implement hrw hash lb as one type of HashingLoadBalancer? @snowp
cc @mattklein123

@mattklein123
Copy link
Member

I think we are trying not add new stuff like this to the core unless necessary. It shouldn't be too much work to add an LB extension point and it would be good to go ahead and do that.

@Agent-Tao
Copy link
Contributor Author

I am not sure how to add LB extension. can you tell me how to do it or give me some reference ? if it is not too much work and nobody work on it, i can take this. thanks. @mattklein123

@mattklein123
Copy link
Member

The basic idea is you need to add a new TypedExtension configuration point for LB. It might be worth it to take a look at this ongoing PR which adds a new extension points and wires everything up. I will admit it's not trivial, but following an example it might not be too bad for the uninitiated. #15619

@mattklein123
Copy link
Member

Cross reference #5598

@Agent-Tao
Copy link
Contributor Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/load balancing design proposal Needs design doc/proposal before implementation enhancement Feature requests. Not bugs or questions. help wanted Needs help!
Projects
None yet
Development

No branches or pull requests

3 participants