mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-06 12:52:53 +02:00
2.8 KiB
2.8 KiB
title | description |
---|---|
Upstream Load Balancing | This article covers Pomerium built-in load balancing capabilities in presence of multiple upstreams. |
Upstream Load Balancing
This article covers Pomerium built-in load balancing capabilities in presence of multiple upstreams.
Multiple Upstreams
You may specify multiple servers for your upstream application, and Pomerium would load balance user requests between them.
policy:
- from: https://myapp.localhost.pomerium.io
to:
- http://myapp-srv-1:8080
- http://myapp-srv-2:8080
::: tip In presence of multiple upstreams, make sure to specify either an active or passive health check, or both, to avoid requests served to unhealthy backend. :::
Active Health Checks
Active health checks issue periodic requests to each upstream to determine its health. See Health Checking for a comprehensive overview.
policy:
- from: https://myapp.localhost.pomerium.io
to:
- http://myapp-srv-1:8080
- http://myapp-srv-2:8080
health_checks:
- timeout: 10s
interval: 60s
healthy_threshold: 1
unhealthy_threshold: 2
http_health_check:
path: "/"
Passive Health Checks
Passive health check tries to deduce upstream server health based on recent observed responses. See Outlier Detection for a comprehensive overview.
Load Balancing Method
lb_policy
should be set to one of the values:
ROUND_ROBIN
(default)LEAST_REQUEST
and may be further configured using ``RING_HASH
and may be further configured usingring_hash_lb_config
optionRANDOM
MAGLEV
and may be further configured usingmaglev_lb_config
option