Documentation ¶
Overview ¶
Bounded is Consistent hashing with bounded loads. It acheives that by adding a capacity counter on every host, and when a host gets picked it, checks its capacity to see if it's below the Average Load per Host.
All opertaions in bounded are concurrency-safe.
Average Load Per Host is defined as follows:
(totalLoad/number_of_hosts)*imbalance_constant
totalLoad = sum of all hosts load
load = the number of active requests
imbalance_constant = is the imbalance constant, which is 1.25 in our case
it bounds the load imabalnce to be at most 25% more than (totalLoad/number_of_hosts).
For more info: https://medium.com/vimeo-engineering-blog/improving-load-balancing-with-a-new-consistent-hashing-algorithm-9f1bd75709ed
https://research.googleblog.com/2017/04/consistent-hashing-with-bounded-loads.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bounded ¶
type Bounded struct {
// contains filtered or unexported fields
}
func (*Bounded) Inc ¶
It should be called once a request is assigned to a host, obtained from b.Balance.