openresty / lua-resty-balancer

A generic consistent hash implementation for OpenResty/Lua
322 stars 77 forks source link

feat: peek from low weights to high weights #48

Closed jizhuozhi closed 1 year ago

jizhuozhi commented 1 year ago

Fixes #47 Peek from low weights to high weights, to ensure the first peeked node is not always the node with largest weight, and give nodes with lower weight more opportunities in a small time window

doujiang24 commented 1 year ago

@jizhuozhi Thanks for your contribution. But, I think it's better to follow nginx's implementation, as suggested here: https://github.com/openresty/lua-resty-balancer/issues/44#issuecomment-1196504823 Thoughts?

jizhuozhi commented 1 year ago

@jizhuozhi Thanks for your contribution. But, I think it's better to follow nginx's implementation, as suggested here: #44 (comment) Thoughts?

Thank you for your reply, as discussed in #44 , nginx's implementation is also O(n), I will discuss in #44

jizhuozhi commented 1 year ago

Hello, @doujiang24 . I will close this PR before having a conclusion abort how to implement WRR in openresty