Cloudflare Load Balancing is a paid add-on, not a plan feature: you can bolt it onto a Free, Pro, or Business zone, and what you get is real — health monitors probing your origins from Cloudflare’s network, pools with ordered failover, and steering decisions made at the edge. What you do not get on the entry tier is fast detection or clever steering: the base health-check interval is 60 seconds, and latency-aware or geo steering sit in higher add-on tiers. Sized honestly, it replaces a self-managed failover tier for a lot of two-origin setups; it does not replace an Enterprise traffic-engineering contract.
What’s happening
The add-on is built from three objects. A monitor defines the probe: method, path, expected codes, interval, timeout, retries. A pool groups one or more origins, attaches a monitor, and declares how many origins must be healthy before the pool itself is marked degraded. A load balancer is a hostname in your zone that maps traffic onto an ordered list of pools — first healthy pool wins under the default (failover) steering.
Failover timing is arithmetic, not magic: detection takes roughly the probe interval times the retry count, plus propagation of the health state. With the 60-second base interval, expect a dead origin to drain in the one-to-few-minutes range. Higher add-on tiers buy shorter intervals (down to sub-15-second checks at the top) and with them faster failover. Probes originate from Cloudflare’s network, from the regions you select — every origin must admit them, which interacts directly with your origin firewall allowlist.
The load balancer hostname can run proxied (steering happens inside Cloudflare, invisible to clients) or DNS-only (steering happens in the DNS answer with a short TTL — failover then also waits on resolver caches). Proxied is the default choice unless you have a reason.
What to check first
- Whether you need this at all. One origin means nothing to steer. Two origins with a manual runbook may be fine if your tolerance for minutes of downtime is honest. The build-vs-buy line is mapped in Cloudflare LB vs self-hosted multi-region.
- What your real recovery target is. If the answer is “seconds”, the base tier’s 60-second probes cannot deliver it; price the faster tiers or reconsider the architecture.
- A health endpoint worth probing.
/healthzthat returns 200 while the database is down will steer traffic confidently into a broken stack. The endpoint should verify the dependencies that matter.
How to verify
Pools and monitors live at the account level; load balancers attach to the zone:
# Monitors defined on the account
curl -s -H "Authorization: Bearer <api-token>" \
"https://api.cloudflare.com/client/v4/accounts/<account-id>/load_balancers/monitors"
# Pools, with per-origin health state
curl -s -H "Authorization: Bearer <api-token>" \
"https://api.cloudflare.com/client/v4/accounts/<account-id>/load_balancers/pools"
# Load balancers on the zone
curl -s -H "Authorization: Bearer <api-token>" \
"https://api.cloudflare.com/client/v4/zones/<zone-id>/load_balancers"
Then rehearse a failure in a window: block the probe path on origin A and watch the pool state flip and traffic drain to origin B.
# On origin A — make the health endpoint fail without touching real traffic
sudo nft add rule inet filter input tcp dport 443 ip saddr @cf4 drop # test window only
# Watch from outside: which origin is serving?
watch -n 10 "curl -s https://www.example.com/whoami"
Time the drain from first failed probe to full cutover; that number, not the marketing page, is your failover SLA.
The runbook
- Create the monitor first. HTTPS probe against a dependency-aware health path, expected code 200, sensible timeout (5 seconds), 2 retries. Keep one monitor per application type, shared across pools, so tuning happens in one place.
- Build pools in failover order. Primary pool with your main origin(s), secondary pool with the standby. Set the healthy-origin threshold deliberately: a two-origin pool that stays “healthy” with one origin down behaves very differently under load than one marked degraded.
- Wire notifications before going live. Pool health transitions should page or at least alert — silent automatic failover means you discover the primary died three days later, during the secondary’s maintenance.
- Create the load balancer on the hostname, proxied, default (failover) steering to start. Fancier steering — weighted random, geo mapping regions to pools, latency-based dynamic steering — belongs to higher add-on tiers; turn it on only after plain failover is proven.
- Drill the failover quarterly. Kill the primary’s health path in a window, time the drain, confirm the alert fired, fail back. An untested failover pool is a hypothesis, not a capability.
When this approach is wrong
Below two genuinely independent origins, the add-on is decoration. If your recovery target is tighter than the probe math can deliver on the tier you can justify, self-hosted balancing with local health checks (or an Enterprise conversation) is the honest path. If you need steering by header, cookie, or custom business logic beyond what Load Balancing rules expose on your tier, that is Workers territory or Enterprise territory — do not contort pools to fake it. And non-HTTP TCP services are out of scope for the standard proxy entirely; that is Spectrum, priced separately.
Common mistakes
- Probing
/instead of a real health endpoint. A cached or static 200 hides a dead application; conversely a heavyweight homepage makes probes expensive and flappy. - Forgetting the probes in the firewall. Origins that drop Cloudflare’s health checks get marked dead while serving real traffic fine — instant, self-inflicted “outage”.
- Assuming Enterprise steering on a Pro add-on. Latency-aware and geo steering are tier-gated within the add-on; failover order and weighted random are the base toolkit. Verify in the dashboard before you promise an RTO.
- Session-sensitive apps without session affinity. Mid-session pool switches log users out; enable affinity by cookie if the app keeps state on the origin.
- DNS-only load balancers with long client caches. The 30-second steering TTL only helps resolvers that honour it; corporate resolvers often do not.
Prevention / maintenance checklist
- Quarterly failover drill with the measured drain time recorded in the runbook.
- Pool notification hooks tested (not just configured) each quarter.
- Monitor config reviewed when the app’s dependency graph changes — the health endpoint must keep telling the truth.
- Add-on tier re-checked against the actual recovery target once a year; both drift.
- Official reference for objects and tiers: developers.cloudflare.com/load-balancing/.
A Cloudflare migration with a written rollback plan, or a zone that gets reviewed quarterly instead of drifting — that is the operating discipline Stack Harbor sells under Managed Cloud Ops; book an infrastructure review.