Browse documentation
Load balancing
Choose the right path through your replicas.
Four ways to share the load
Choose a strategy per route with dr.loadbalancer. The default is roundrobin.
| Value | Behavior |
|---|---|
| roundrobin | Rotate requests through the available pool |
| weighted | Prefer backends according to dr.weight |
| iphash | Use a stable client IP based selection |
| leastconn | Prefer the backend with fewer active connections |
Label services, scale replicas
Containers with the same route feed the backend pool. Keep consistent host and path labels across replicas, and make every replica reachable from the router.
labels:
dr.enable: "true"
dr.host: "api.example.com"
dr.loadbalancer: "leastconn"
dr.healthcheck.path: "/health"Let health checks guide selection
Active health checks take failing backends out of rotation and return recovered instances after consecutive successful probes. The last healthy backend is not ejected by this policy. Configure your health endpoint and thresholds explicitly.
dr.healthcheck.path: "/health"
dr.healthcheck.interval: "10s"
dr.healthcheck.timeout: "5s"
dr.healthcheck.threshold: "3"
dr.healthcheck.recovery: "2"Plan failure behavior
The dr.retry label sets the retry count, while dr.circuitbreaker configures a failure threshold and window. Consider how retrying affects your application’s non-idempotent operations before enabling retries.
dr.retry: "2"
dr.circuitbreaker: "5/30s"