Load balancer
Run several upstreams behind one public endpoint. Start simple, then add health checks and runtime controls.
Dva upstreama
[[vhosts.routes]]
name = "app"
path_prefix = "/"
action = "proxy"
[vhosts.routes.proxy]
upstreams = [
"10.0.0.11:8080",
"10.0.0.12:8080",
]
upstream_weights = [100, 50]
upstream_aliases = ["app-a", "app-b"]
Balancing kontrole
| Kontrola | Uporabi kada |
|---|---|
upstream_weights | Backend trebaju dobiti različne udjele traffic. |
backup_upstreams | Neki backend trebaju se uporabljati samo kada primary izbori zakažu. |
drain_upstreams | Backend treba završiti postojeći posao, ali ne primati novi traffic. |
disabled_upstreams | Backend mora ostati izvan rotacije. |
upstream_max_in_flight | Backend treba local concurrency cap. |
Dinamički upstream file
[vhosts.routes.proxy]
upstreams_file = "/run/fluxheim/backends/app.txt"
upstreams_file_refresh_secs = 5
Uporabi static upstream kada trebaš weights, aliases, backup, drain ali disabled state. File in DNS refreshed pool namjerno drže contract manjim.
Kaj dobivaš
- Focused load-balancer release images are available.
- Health check lahko držati neispravne backend izvan rotacije.
- Drain in force-down operacije pomažu tijekom maintenance window.
- Managed-cookie affinity dostupan je kada session treba stabilan backend.