API Reference rpc_load_balancer v#0.3.0

Copy Markdown View Source

Modules

Distributed RPC load balancer built on :pg.

Configuration defaults for RpcLoadBalancer.

GenServer responsible for joining the :pg group, monitoring membership changes, and performing graceful connection draining on shutdown.

Shared atomic counters for slot-based round-robin and per-node connection tracking across all load balancers.

Tracks in-flight RPC calls and provides graceful connection draining.

Shared atomic counter for tracking in-flight calls per load balancer.

Assigns unique integer indices to arbitrary keys for a given cache.

Cache for parsed, immutable per-load-balancer options.

Shared ETS cache for CPU metrics, keyed by node.

Behaviour for load balancer node selection.

Selection algorithm that executes calls directly on the local node.

Consistent hash ring node selection algorithm powered by libring.

Least connections node selection algorithm.

Least CPU node selection algorithm.

GenServer that periodically samples local CPU via :cpu_sup and fetches remote node CPU via :erpc.multicall/5, storing all results in NodeCpuCache.

Power of Two Choices node selection algorithm.

Round robin node selection algorithm.

Weighted round robin node selection algorithm.

Retry logic for RPC operations that may fail when no nodes are available.