RpcLoadBalancer.LoadBalancer.SelectionAlgorithm.WeightedRoundRobin
(rpc_load_balancer v0.2.1)
Copy Markdown
View Source
Weighted round robin node selection algorithm.
Accepts a weight map via algorithm_opts where keys are node names and
values are positive integers representing relative capacity. Nodes with
higher weights receive proportionally more traffic.
Usage
RpcLoadBalancer.LoadBalancer.start_link(
name: :my_balancer,
selection_algorithm: RpcLoadBalancer.LoadBalancer.SelectionAlgorithm.WeightedRoundRobin,
algorithm_opts: [weights: %{:"node1@host" => 3, :"node2@host" => 1}]
)Nodes not present in the weight map receive a default weight of 1.