Module lb
Available on crate feature
dns only.Expand description
DNS-based client-side load balancer.
DnsLoadBalancer resolves a request’s target domain, caches the result,
refreshes it in the background, and selects one resolved IP per request via
a DnsIpPicker strategy. The selected endpoint is published on
the request as a ConnectorTarget extension so a downstream
connectors (tcp, pool…) connects straight to that IP, the original authority
stays intact (needed for things like TLS sni).
Example use case: rotating GPRC requests between different IPs of a headless service.
Structs§
- DnsLoad
Balancer - Service that pins each request to an IP picked from the resolved DNS entries
- DnsLoad
Balancer Config - DNS loadbalancer config used by
DnsLoadBalancerLayerandDnsLoadBalancer. - DnsLoad
Balancer Layer Layerproducing aDnsLoadBalancerservice from aDnsLoadBalancerConfig.- Host
Resolution - The data a
DnsIpPickersees for a single host - Random
Picker - Random IP picker
- Round
Robin Picker - Round-robin IP picker
Constants§
- DEFAULT_
LB_ EVICT_ AFTER_ IDLE - DEFAULT_
LB_ EVICT_ AFTER_ STALE - DEFAULT_
LB_ MAX_ ENTRIES - DEFAULT_
LB_ REFRESH_ AFTER
Traits§
- DnsIp
Picker - Strategy that selects one
IpAddrfrom aHostResolution.