You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any plans to support additional load balancing schemes like hashing, least conn, etc? Regular old hashing wouldn't seem too hard (same with least_conn); consistent (ketama) hashing has already been done in https://github.com/agentzh/lua-resty-chash; perhaps we could wrap this? I'll happily contribute if you think this is worthwhile (I'd love to be able to wrap this lib using chashing for lua-resty-waf to connect to a cluster of persistent variable storage backends).
The text was updated successfully, but these errors were encountered:
Hey, yeah having other balancing methods was always in the plan.
At the moment I don't have a need for anything other than round-robin, so I don't have any concrete plans to add other methods myself.
More than happy to accept contribution for other methods though!
Should just be a case of adding a function to the available_methods table.
Maybe we need a register_balance_method function to add to that table dynamically or something...
p0pr0ck5
added a commit
to p0pr0ck5/lua-resty-upstream
that referenced
this issue
Jul 1, 2016
Add a new hash load balancing method to resty.upstream.socket. This
hash is a CRC32 of the given key modulo the sum of weights of
available hosts. 'Available hosts' are determined before a connection
attempt is made, so that host weights can be taken into account when
deriving the hash. This stands in contrast to the existing round
robin implementation, which walks the entire list of host and then
checks its availability after making a weighted decision.
Hash keys can be provided by an optional param to upstream:connect().
It would make more sense to provide a function to derive the key as
part of defining the pool, but because pools are serialized as JSON,
this is a no-go.
See issue hamishforbes#12 for the initial discussion regarding additional load
balancing schemes.
Any plans to support additional load balancing schemes like hashing, least conn, etc? Regular old hashing wouldn't seem too hard (same with least_conn); consistent (ketama) hashing has already been done in https://github.com/agentzh/lua-resty-chash; perhaps we could wrap this? I'll happily contribute if you think this is worthwhile (I'd love to be able to wrap this lib using chashing for lua-resty-waf to connect to a cluster of persistent variable storage backends).
The text was updated successfully, but these errors were encountered: