Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimeIntervalFileName ¶
Types ¶
type W1 ¶
type W1 struct {
// contains filtered or unexported fields
}
W1 is struct that contains weighted servers and provides methods to select a weighted server. It is used for the smooth weighted round-robin balancing algorithm. This algorithm is implemented in Nginx: https://github.com/phusion/nginx/commit/27e94984486058d73157038f7950a0a36ecc6e35.
Algorithm is as follows: on each peer selection we increase current_weight of each eligible peer by its weight, select peer with greatest current_weight and reduce its current_weight by total number of weight points distributed among peers.
In case of { 5, 1, 1 } weights this gives the following sequence of current_weight's: (a, a, b, a, c, a, a)
func (*W1) NextWeighted ¶
NextWeighted returns next selected weighted object.