Documentation ¶
Overview ¶
Package p2c helps you to to select two nodes randomly from all available nodes and then select a less loaded node based on the load of these two nodes (in other words - "Power of Two"). Algorithm is an improved random algorithm that avoids the worst selection and load imbalances. The P2C approach is not as effective on a single load balancer, but it deftly avoids the bad‑case “herd behavior” that can occur when you scale out to a number of independent load balancers.
Index ¶
Constants ¶
View Source
const (
// Name is p2c(Pick of 2 choices) balancer name
Name = "p2c"
)
Variables ¶
This section is empty.
Functions ¶
func NewBuilder ¶
NewBuilder returns a selector builder with p2c balancer
Types ¶
type Balancer ¶
type Balancer struct {
// contains filtered or unexported fields
}
Balancer is p2c selector.
Click to show internal directories.
Click to hide internal directories.