skip to content

In Cloudflare Load Balancing, what roles do the load balancer, its pools, their endpoints and the health monitors each play?

level: juniorimportance: should knowfreq 36%

answer

  1. a hostname with logic behind it
  2. pools group endpoints
  3. weights inside a pool
  4. monitors attach to pools

basics

~20 s

A Cloudflare load balancer is a hostname on a zone that picks a pool for each request. A pool groups endpoints, the origin addresses with weights. A monitor attached to the pool probes those endpoints so only healthy ones receive traffic.

solid answer

~40 s

Cloudflare Load Balancing has three building blocks. The **load balancer** lives on a zone and answers for one hostname, such as `api.example.com`; Cloudflare creates an LB DNS record for it, and the load balancer holds the ordered list of pools, the **fallback pool**, the traffic steering policy, session affinity and the proxied or DNS-only switch. A **pool** is an account-level group of **endpoints** (an IP address or hostname each, with a weight from 0 to 1, default 1) plus a **Health Threshold**: how many endpoints must be healthy for the pool to receive traffic. A **monitor** is an account-level probe definition (type, path, port, expected codes, interval) attached to a pool; it decides which endpoints count as healthy. Pools and monitors can be reused by several load balancers.

go deeper

for a junior

Name the four pieces and say what each holds: the load balancer is the hostname, pools group endpoints, endpoints carry weights, monitors decide health.

for a middle

Explain where each object lives (zone versus account), how the LB DNS record outranks an equally specific record, and how weights and the Health Threshold shape traffic.

for a senior

Show you would lay pools out per site so failover is a pool decision, reuse monitors deliberately, and know that a missing monitor silently turns health off.

for a principal

Treat pools and monitors as shared account assets: decide who may edit them, since one change to a shared pool or monitor alters every load balancer that uses it.

## The pieces and where they live Cloudflare Load Balancing is a paid add-on: an account needs a billing profile before **Enable Load Balancing** works. Once it is on, you configure three kinds of objects, and they do not all live at the same level. | Object | Lives on | What it holds | |---|---|---| | **Load balancer** | a zone (API path `/zones/:zone_id/load_balancers`) | the hostname, the ordered pools, the **fallback pool**, the steering policy, session affinity, proxied or DNS-only | | **Pool** | the account (`/accounts/:account_id/load_balancers/pools`) | the endpoints, their weights, the endpoint steering policy, the **Health Threshold**, the attached monitor and its probe regions | | **Endpoint** | inside a pool | an IP address or hostname, a weight, an optional `Host` header and port | | **Monitor** | the account (`/accounts/:account_id/load_balancers/monitors`) | probe type, path, port, expected codes, interval, timeout and retries | Because pools and monitors belong to the account, one pool (say, the on-premises data center) can serve several load balancers on different zones, each with its own failover order. ## The load balancer: a hostname with logic behind it When you create a public load balancer for `api.example.com`, Cloudflare automatically creates an **LB DNS record** for that hostname. Instead of returning a fixed address, Cloudflare runs the load balancer's logic for each request: which pools are healthy, which one the steering policy prefers, which endpoint inside that pool to use. A few behaviours follow from this: - **Existing records.** If the hostname already has an `A`, `AAAA` or `CNAME` record, the LB record wins when it is as specific as that record. A wildcard LB record (`*.example.com`) loses to a more specific record such as `y.example.com`. - **Proxy mode.** An orange-cloud (proxied) load balancer works at layer 7: Cloudflare's edge picks the endpoint per HTTP request. A gray-cloud (DNS-only) one returns endpoint addresses in DNS answers instead. - **Disabling it.** A disabled load balancer stops sending traffic to any of its pools; the hostname then answers from your ordinary DNS records, or fails if there are none. - **Private load balancers** get no hostname at all; they take a private IP and are reached over a private network on-ramp. ## Pools and endpoints A **pool** is how you group endpoints. A common layout gives each site its own pool: one pool per cloud region and one for an on-premises data center. Each **endpoint** carries a **weight** between 0 and 1 (in steps of 0.01, default 1). Inside the pool, the share an endpoint receives is its weight divided by the sum of the weights, filtered through the pool's **endpoint steering** policy (Random, Hash or Least Outstanding Requests). An endpoint with weight 0 receives none of that pool's traffic but is still probed by the monitor. The pool's **Health Threshold** (the `minimum_origins` field in the API) is the number of healthy endpoints the pool needs to count as healthy as a whole. Raise it and the pool fails over sooner, before it is left running on too few servers. ## Monitors A **monitor** describes a probe: its **type** (HTTP, HTTPS or TCP on most plans; Enterprise adds UDP-ICMP, ICMP Ping and SMTP), a **path** such as `/health`, a **port**, the **expected codes** (`200`, or a range like `2xx`), an optional expected response body, the **interval**, **timeout** and **retries**. You attach a monitor to a pool and choose the pool's **Health Monitor Regions**; Cloudflare then probes every endpoint from three data centers in each chosen region. Load Balancing monitors are a separate feature from standalone Health Checks, which only report health and never steer traffic. Without a monitor, health is not considered at all: an Off-steering load balancer sends everything to its first pool. ## How one request flows 1. A client asks for `api.example.com`, and the LB DNS record answers. 2. On a proxied load balancer, the Cloudflare data center handling the request takes the pools that are healthy according to their monitors. 3. The **traffic steering** policy chooses one of those pools (failover order, random by weight, geography, latency, proximity or outstanding requests). 4. The pool's **endpoint steering** and the endpoint weights choose one endpoint, unless session affinity already pins the client to one. 5. If every pool is unhealthy, the **fallback pool** takes the request, because traffic still has to go somewhere. ## Applied to an API in two regions and on premises An API served from two cloud regions and an on-premises site maps onto one load balancer for `api.example.com`, three pools (`cloud-east`, `cloud-west`, `onprem-dc`), each with two or three endpoints, and one HTTPS monitor probing `/health` and expecting `200`, attached to all three pools. The pool order and the steering policy decide which region normally serves; the monitor results decide when that changes.

  • Why are pools and monitors account-level objects while the load balancer belongs to a zone?
    A load balancer answers for one hostname, and hostnames belong to zones, so it is created on a zone. Pools and monitors describe your servers and how to probe them, which several sites can share. Keeping them at the account lets you reuse one on-premises pool and one monitor across load balancers on different zones, each with its own pool order, without duplicating endpoint lists.
  • What happens to traffic for a hostname when its Cloudflare load balancer is disabled?
    Disabling it stops traffic to every pool, the fallback pool included. Requests for the hostname then follow its ordinary DNS records if any exist, and fail if none do. Because the LB record had taken precedence over an equally specific record, re-enabling or disabling it changes what the name resolves to, and resolver caching can delay the change.

A dispatcher at a taxi rank: the rank is the hostname, each company's fleet is a pool, the cars are endpoints, and a supervisor walks the line checking which cars can actually drive before the dispatcher assigns a passenger.

  • A pool belongs to one load balancer and cannot be reused
  • An endpoint with weight 0 is no longer health-checked
  • You must delete the existing A record before creating the load balancer
  • The monitor is attached to the load balancer, not to pools
  • Without a monitor, Off steering still fails over when an endpoint dies