Load Balancing

Steer traffic. Survive failures. Live.

Watch traffic re-route when a pool fails.

LOAD BALANCERORIGIN POOLS5 of 5 healthyCF LBsteeringUS-East originAshburn · healthy0%US-West originPortland · healthy0%EU originFrankfurt · healthy0%APAC originSingapore · healthy0%Fallback poolMulti · healthy0%

Origin pool

US-East origin

Region: Ashburn. Cloudflare LB sends ~30% of traffic to this pool when all members are healthy. Health checks run from every Cloudflare PoP; on failure, traffic re-routes to healthy peers within seconds.

On this page
AI summary Machine-readable context is available at /ai-index.json

Nanosek provides Cloudflare Load Balancing services for organizations that need traffic steering, origin resilience, health-check-based failover, and multi-region distribution. The service covers architecture design, origin pool configuration, health check design, traffic steering policy selection, session affinity, geo routing, weight-based distribution, failover testing, monitoring, and managed Cloudflare operations.

cloudflarecloudflare load balancingtraffic steeringorigin failoverhealth checksgeo routingsession affinitymulti-region

Who this is for

Platform, infrastructure, and SRE teams running applications that need traffic distribution, origin failover, and resilience across data centers, regions, or cloud providers.
Organizations deploying Cloudflare Load Balancing and needing architecture guidance, health check design, traffic steering configuration, and validation.
Teams migrating from existing load balancers such as F5, AWS ALB/NLB, Azure Load Balancer, or NGINX to Cloudflare-managed traffic distribution.

What Cloudflare Load Balancing helps solve

Single origin failure causing outages

Without load balancing and health checks, a single origin failure takes down the entire application. Cloudflare Load Balancing detects failures and routes traffic to healthy origins within seconds.

No traffic distribution across data centers

Applications deployed across multiple data centers or regions need traffic distributed to match capacity, latency, and geographic routing requirements.

Manual failover dependent on DNS TTL

DNS-based failover is slow, unreliable, and creates long outage windows. Cloudflare Load Balancing uses health checks and steering to move traffic in near real-time without waiting for DNS propagation.

Origin overload during traffic spikes

Weighted distribution and active health checks let Nanosek design origin pools that spread load proportionally and protect origins from sudden traffic spikes.

Multi-cloud traffic management complexity

Organizations running workloads across AWS, Azure, GCP, and on-premises need a single traffic management layer. Cloudflare Load Balancing provides a unified steering and failover model.

No geographic routing for global applications

Geo steering routes users to the nearest origin region by latency or geographic location, reducing round-trip time and improving user experience for globally distributed applications.

Session affinity requirements

Applications with stateful sessions that cannot be broken mid-journey need session affinity policies that keep returning users on the same origin pool.

Canary and progressive traffic shifting

Weighted steering allows controlled traffic shifting to new origins, regions, or application versions for canary deployments and progressive rollouts.

Latency-sensitive routing decisions

Dynamic steering uses real-time origin latency data to select the fastest origin at the time of each request rather than relying on static weight assignments.

No visibility into origin health and traffic distribution

Cloudflare Load Balancing analytics provide pool-level health status, origin response time, failover events, and traffic distribution visibility through dashboards and Logpush.

Absence of health-check-aware WAF and bot decisions

Load Balancing integrates with Cloudflare WAF and Bot Management so security decisions can account for origin capacity and health state when steering traffic.

Migration from legacy load balancers

Migrating from F5, HAProxy, AWS ALB, NGINX, or hardware load balancers requires policy translation, health check parity, session handling review, and a tested cutover plan.

Why load balancing needs careful design

Load balancing configuration errors can route users to degraded origins, break session-dependent flows, or cause failover loops. Nanosek designs health checks, pool thresholds, and traffic steering policies with testing gates before production traffic is moved.

Health check false positivesSession affinity breaking mid-journeyPool threshold misconfigurationGeo steering affecting complianceWeighted distribution causing origin overloadFailover routing to undersized originsDNS TTL interaction with steering changesOrigin header and SNI configuration differences

Our Cloudflare Load Balancing approach

Phase 1

Architecture and traffic discovery

  • Inventory current origin infrastructure, load balancing configuration, traffic patterns, geographic distribution, session requirements, and health check design.
  • Identify critical application paths, peak traffic windows, session affinity requirements, failover expectations, and any compliance or geographic routing constraints.
Phase 2

Pool and routing design

  • Design origin pool structure, pool membership rules, failover pool hierarchy, and traffic steering mode for each application or hostname.
  • Select between round-robin, weighted, geo, latency, and random steering based on application requirements and infrastructure topology.
Phase 3

Health check and failover design

  • Design health check type, interval, threshold, path, expected status, follow redirects, and notification configuration for each origin pool.
  • Define the pool degraded and critical thresholds that trigger failover, and design the fallback pool chain for each hostname.
Phase 4

Implementation and integration

  • Configure origin pools, origins, health checks, load balancing records, steering policies, session affinity, and fallback pool chains in Cloudflare.
  • Integrate with WAF, Bot Management, Cache Rules, and Workers where origin selection should interact with security or caching decisions.
Phase 5

Validation and failover testing

  • Test health check behavior, failover trigger timing, origin recovery behavior, session affinity persistence, and geo steering routing across test origins.
  • Validate traffic distribution under synthetic load, confirm Logpush and dashboard visibility, and prepare cutover runbooks.
Phase 6

Production cutover

  • Move production DNS to use Cloudflare Load Balancing records using a tested cutover plan with reduced TTLs, validation steps, and rollback preparation.
  • Monitor pool health, failover events, traffic distribution, origin response times, and error rates during and after cutover.
Phase 7

Optimization and managed operations

  • Tune health check thresholds, pool weights, steering policies, and alerting after production data is available.
  • Provide ongoing managed Cloudflare operations including pool health monitoring, failover event review, configuration updates, and capacity planning support.

Architecture

Origin pool topology: pool hierarchy, primary and fallback pool chain, pool membership model, regional distribution, and origin health threshold design.
Traffic steering model: round-robin, weighted, latency, geo, or random steering per hostname, with session affinity and steering override design where needed.
Health check design: check type, interval, threshold, path, expected response, failure detection time, and notification configuration for each pool.
Integration with Cloudflare services: WAF, Bot Management, Cache Rules, Workers, Logpush, and analytics for unified traffic management and observability.

Cloudflare Load Balancing controls we use

Origin pools

Define groups of origin servers with shared health-check and traffic-steering settings for each application or hostname.

Origins

Individual backend servers or addresses within a pool, with weight, enabled/disabled state, and header configuration.

Load Balancing records

DNS records that point a hostname to a load balancer, enabling Cloudflare to steer traffic rather than returning a static IP.

Health checks

Periodic requests to origins that determine pool health status and trigger failover when origins fall below threshold.

Round-robin steering

Distribute requests across all healthy origins in a pool in sequence, without weighting or location awareness.

Weighted steering

Assign relative traffic weight to each origin or pool for proportional distribution, canary deployments, or migration traffic shifting.

Geo steering

Route traffic to a specific origin pool based on the geographic region of the incoming request.

Latency steering

Route each request to the origin pool with the lowest measured latency at request time using real-time probe data.

Random steering

Distribute requests randomly weighted by origin capacity, useful for simpler setups without latency or geo requirements.

Fallback pools

Define a backup pool that receives traffic when all primary pools are degraded or unavailable.

Pool degraded threshold

Set the percentage of healthy origins below which a pool is considered degraded and traffic moves to the next pool in the chain.

Pool critical threshold

Set the percentage of healthy origins below which a pool is considered critical and all traffic is immediately moved to fallback.

Session affinity

Keep returning users on the same origin pool for the duration of a session to preserve state in stateful applications.

Session affinity TTL

Control how long session affinity cookies persist before the user is re-steered based on current pool health and steering policy.

Steering overrides

Override the default steering policy for specific regions or conditions to handle special routing requirements.

Origin headers

Configure per-origin Host headers and SNI to ensure correct backend routing when origins expect specific header values.

Origin probing intervals

Set how frequently health checks run per origin, balancing detection speed against origin load from health check traffic.

Health check notifications

Alert operations teams when pool health changes, origins fail, or failover events are triggered.

Cloudflare DNS integration

Load Balancing records replace standard DNS records, enabling Cloudflare to steer traffic at the DNS layer with near-real-time failover.

Logpush for Load Balancing

Export load balancing events, health check results, pool changes, and traffic distribution data to SIEM or analytics platforms.

GraphQL Analytics

Review traffic distribution, pool health, failover events, origin response times, and steering behavior through the Cloudflare dashboard.

Workers integration

Use Workers for advanced traffic routing logic that requires request-level context, custom origin selection, or dynamic backend decision making.

Terraform / API automation

Manage load balancer configuration, pool definitions, health checks, and steering policy through Terraform or the Cloudflare API for repeatable deployment.

Spectrum (TCP/UDP) load balancing

Used for non-HTTP workloads requiring TCP or UDP load balancing with Cloudflare network-layer traffic distribution where applicable.

Traffic steering patterns

Active-passive failover

Use case

Single-region application with a standby backup

Design notes

Primary pool with all active origins; fallback pool on standby. Health check triggers automatic failover when primary crosses degraded threshold.

Active-active multi-region

Use case

Traffic distributed across two or more regions under normal conditions

Design notes

Geo or latency steering across regional pools. Each region receives its local traffic; failover routes to alternate region.

Weighted traffic distribution

Use case

Gradual traffic shift during migration or canary release

Design notes

Origin or pool weights set to divide traffic proportionally. Weights adjusted incrementally with validation gates.

Geo routing by continent or country

Use case

Data residency, latency optimization, or CDN origin placement

Design notes

Region-specific pools mapped to geographic zones. Fallback pool handles traffic from regions without a dedicated assignment.

Latency-based steering

Use case

Global application where closest origin varies by user location

Design notes

Dynamic steering uses real-time probe latency to select the fastest pool at request time rather than a static geo assignment.

Session-affinity stateful application

Use case

Application with server-side session state that cannot tolerate mid-session re-routing

Design notes

Session affinity configured with appropriate TTL. Pool health events handled with graceful drain and fallback routing.

Multi-cloud traffic distribution

Use case

Workloads running across AWS, Azure, GCP, and on-premises

Design notes

Each cloud provider represented as a pool or as origins within a pool. Weights or steering policies manage cross-cloud distribution.

Blue-green deployment traffic switching

Use case

Zero-downtime application version switch

Design notes

Blue and green pools defined. Weight shifted from blue to green incrementally or in a single switch with rollback pool ready.

API gateway origin routing

Use case

API platform with multiple backend services behind a single hostname

Design notes

Workers-based routing or separate load balancer records per API path. Each pool targets the appropriate backend service.

DDoS and incident traffic redirect

Use case

Routing traffic away from an attacked or degraded origin

Design notes

Manual or health-check-triggered pool disabling routes traffic to clean origins. Nanosek prepares runbooks for incident-time execution.

Deployment steps

  1. 01 Inventory current origin infrastructure, traffic patterns, geographic distribution, session requirements, health check design, and any migration from existing load balancers.
  2. 02 Design origin pool structure, pool hierarchy, failover pool chain, and traffic steering mode for each hostname and application.
  3. 03 Design health check configuration including check type, interval, threshold, path, expected response, and failure detection timing.
  4. 04 Configure origin pools, origins, load balancing records, steering policies, session affinity, and fallback pool chains in Cloudflare.
  5. 05 Test health check behavior, failover trigger, origin recovery, session affinity persistence, and geo or latency steering routing.
  6. 06 Execute DNS cutover with a tested plan, reduced TTLs, validation steps, and rollback preparation.
  7. 07 Tune health check thresholds, pool weights, and steering policies based on production data and operate with dashboards, alerting, and managed operations workflows.

Risks and mitigations

Risk

Health check false positives causing unnecessary failover.

Mitigation

Design health checks with appropriate interval, timeout, and consecutive failure threshold. Test against realistic origin response times before production.

Risk

Session affinity breaking during pool failover.

Mitigation

Design session affinity TTL to match application session lifetime. Test session handling during planned failover events before production.

Risk

Origin not allowlisting Cloudflare probe IPs.

Mitigation

Update origin firewall and security group rules to allow inbound health check traffic from Cloudflare IP ranges before enabling health checks.

Risk

Pool threshold misconfiguration routing traffic to degraded origins.

Mitigation

Set degraded and critical thresholds based on realistic failure scenarios and test threshold trigger and recovery behavior before cutover.

Risk

DNS TTL causing slow failover during cutover.

Mitigation

Reduce DNS TTL to 60 seconds or less at least 24 hours before cutover. Revert TTL to standard values after load balancing is confirmed stable.

Risk

Geo routing sending traffic to wrong region under compliance requirements.

Mitigation

Review geo steering region assignments against data residency and compliance requirements. Test routing from representative regions before production.

Risk

Weighted steering overloading a smaller origin during migration.

Mitigation

Set initial weights conservatively and increase incrementally. Monitor origin response times and error rates during each weight adjustment.

Risk

Failover pool undersized for full traffic volume.

Mitigation

Confirm fallback pool capacity is sufficient to absorb the full expected traffic load from the primary pool. Test at estimated production volume.

Risk

Load balancer configuration drift from Terraform or change management.

Mitigation

Manage all load balancing configuration through Terraform or the Cloudflare API with change approval workflow and configuration drift detection.

Risk

Workers-based routing logic introducing latency.

Mitigation

Profile Worker execution time under production-like request rates. Use native load balancing controls where they meet routing requirements without Worker overhead.

Load balancing validation checklist

  • All origin servers and addresses documented
  • Origin capacity and maximum connection limits understood
  • Health check paths and expected responses confirmed
  • Health check intervals and thresholds tested
  • Pool degraded and critical thresholds configured
  • Fallback pool chain defined for all hostnames
  • Traffic steering mode selected and validated
  • Geo steering region assignments reviewed
  • Session affinity requirements confirmed
  • Session affinity TTL set appropriately
  • Origin Host headers and SNI confirmed
  • Origin allowlisting updated for Cloudflare probe IPs
  • Failover behavior tested by disabling individual origins
  • Failover recovery behavior tested by re-enabling origins
  • Full pool failure and fallback routing validated
  • DNS cutover plan prepared with TTL reduction steps
  • Rollback plan prepared for DNS cutover reversal
  • Logpush or analytics visibility confirmed for pool events
  • Health check notification alerting configured
  • WAF and Bot Management behavior validated with new load balancer routing
  • Session affinity persistence validated across pool failover

Deliverables

  • Origin infrastructure and traffic pattern inventory
  • Load balancing architecture design
  • Origin pool and failover pool structure
  • Health check design per pool
  • Traffic steering policy selection and configuration
  • Session affinity design
  • Cloudflare Load Balancing implementation
  • Failover and recovery test report
  • DNS cutover plan and rollback steps
  • Dashboard and alerting configuration
  • Load balancing runbooks for operations teams
  • Terraform or API automation for configuration management
  • Managed operations handover and ongoing optimization backlog

When Nanosek should help

You are running an application across multiple origins, data centers, or cloud providers and need controlled traffic distribution.
You are experiencing single-origin failures that cause full outages and need health-check-based failover.
You need geographic traffic routing for latency optimization or data residency requirements.
You are migrating from F5, AWS ALB/NLB, Azure Load Balancer, NGINX, or another load balancer to Cloudflare.
You need session affinity for stateful applications and want to avoid mid-session routing changes.
You are deploying a canary release or blue-green switch and need controlled, weighted traffic shifting.
You need a load balancing architecture review before a major infrastructure or cloud migration.
You need managed Cloudflare operations for ongoing pool health monitoring, failover review, and configuration management.
You want Terraform or API-managed load balancing configuration aligned with your change management process.

Frequently asked questions

What is Cloudflare Load Balancing?
Cloudflare Load Balancing distributes traffic across multiple origin servers or pools using health-check-aware steering policies. It supports round-robin, weighted, geo, latency, and random steering, with session affinity and fallback pool failover built in.
How fast does Cloudflare Load Balancing detect and respond to origin failure?
Detection speed depends on the health check interval and consecutive failure threshold. With a 60-second interval and 2 consecutive failures, detection and failover can occur within two to three minutes. Shorter intervals reduce detection time but increase health check traffic to origins.
Can Cloudflare Load Balancing route traffic across AWS, Azure, and on-premises simultaneously?
Yes. Origin pools can include endpoints from any cloud provider or on-premises infrastructure. Nanosek designs the pool and steering model to match your multi-cloud or hybrid topology.
Does Cloudflare Load Balancing support session affinity?
Yes. Session affinity keeps returning users on the same origin pool for the duration of a session using a cookie-based mechanism. Nanosek configures the affinity TTL to match application session lifetime and tests behavior during pool failover events.
Can we use Cloudflare Load Balancing for a canary or blue-green deployment?
Yes. Weighted steering lets you shift a percentage of traffic to a new origin or application version and increase the weight incrementally as validation proceeds. Nanosek designs the pool structure and weight adjustment plan for safe canary rollouts.
What happens when all origins in a pool are unhealthy?
Traffic moves to the next pool in the fallback chain. Nanosek designs the fallback pool hierarchy and tests full primary pool failure to validate that fallback routing works correctly before cutover.
Do origins need to be updated to allow Cloudflare health check traffic?
Yes. Origins need to allow inbound traffic from Cloudflare health check probe IPs. Nanosek provides the current Cloudflare IP ranges and validates allowlisting before enabling health checks.
Can Cloudflare Load Balancing work with Workers for advanced routing?
Yes. Workers can be used for routing logic that requires request-level context, custom origin selection, or dynamic backend decisions that go beyond native steering policies. Nanosek uses Workers only when native load balancing controls cannot meet the routing requirement.
Can Nanosek manage Cloudflare Load Balancing after deployment?
Yes. Nanosek can provide managed Cloudflare operations for load balancing, including pool health monitoring, failover event review, configuration updates, Terraform management, capacity planning support, and regular optimization.

Route production traffic with confidence

Nanosek designs and deploys Cloudflare Load Balancing with the architecture, health check design, failover validation, and managed operations your applications need for reliable traffic distribution.

Ready to talk?

Deliver Cloudflare without surprises.

Whether you're migrating, hardening, or operating Cloudflare — Nanosek brings authorized MSP & ASDP delivery, rollback-ready cutovers, and managed operations after launch.