Skip to content

Cloudflare Load Balancing — Geo, Proximity & Random Steering Policies

DodaTech Updated 2026-06-23 4 min read

In this tutorial, you'll learn about Cloudflare Load Balancing. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.

Cloudflare Load Balancing steering policies determine how traffic is routed across pools to optimize latency, Compliance, and resource utilization. This tutorial covers geo steering, proximity steering, random steering, and dynamic steering with real configuration examples you can apply immediately.

Why Steering Policies Matter

Without a steering policy, Cloudflare routes traffic to the pool with the lowest latency by default. That works for simple setups, but global applications need finer control. You might want visitors from Germany to hit a Frankfurt data center, or distribute traffic evenly across pools during a Migration. Steering policies give you that control.

Real-world use: DodaZIP routes European users to EU-based servers using geo steering to comply with GDPR data residency requirements while US users are served from domestic data centers for lower latency.

Steering Policy Comparison

flowchart LR
  U[User Request] --> LB[Load Balancer]
  LB --> S{Steering Policy}
  S -->|Geo| G[Route by country]
  S -->|Proximity| P[Route by distance]
  S -->|Random| R[Distribute evenly]
  S -->|Dynamic| D[Lowest latency]
  S -->|Standard| ST[Default latency]
  G --> POOL[Selected Pool]
  P --> POOL
  R --> POOL
  D --> POOL
  ST --> POOL
  POOL --> ORIGIN[Origin Servers]
  style LB fill:#f90,color:#fff
  style S fill:#09c,color:#fff

Geo Steering

Geo steering routes traffic based on the visitor's country. You map countries or regions to specific pools. This is essential for data residency Compliance and localized content delivery.

# Geo steering configuration via API
curl -X PUT https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/{lb_id} \
  -H "Authorization: Bearer {api_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "steering_policy": "geo",
    "description": "GDPR-compliant geo load balancer",
    "rules": [
      {"name": "EU traffic", "country": "DE", "pool": "eu-frankfurt", "disabled": false},
      {"name": "US traffic", "country": "US", "pool": "us-east", "disabled": false},
      {"name": "Default pool", "country": "*", "pool": "us-east", "disabled": false}
    ]
  }'

# The asterisk acts as a catch-all for unmapped countries
# Map multiple countries to the same pool
# DE, FR, IT, ES -> eu-frankfurt
# GB, IE, NL -> eu-london
# US, CA -> us-east
# * -> us-east (fallback)

Proximity Steering

Proximity steering routes traffic to the pool physically closest to the visitor based on latitude and longitude. This works well when you have data centers spread globally and want automatic distance-based routing.

# Enable proximity steering via API
curl -X PUT https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/{lb_id} \
  -H "Authorization: Bearer {api_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "steering_policy": "proximity",
    "description": "Proximity-based routing"
  }'

# Cloudflare calculates the great-circle distance between visitor IP
# geolocation and each pool's configured coordinates
# Set pool coordinates (latitude, longitude)
# US East: 37.7749, -122.4194
# EU West: 48.8566, 2.3522
# APAC: 35.6762, 139.6503
# Cloudflare uses these to compute proximity rankings

Random Steering

Random steering distributes traffic across pools with equal probability. This is useful for A/B testing, blue-green deployments, or gradually shifting traffic during migrations.

# Random steering config
curl -X PUT https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/{lb_id} \
  -H "Authorization: Bearer {api_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "steering_policy": "random",
    "description": "Even traffic distribution for canary testing"
  }'

# Each pool receives roughly equal traffic regardless of latency or geography
# Random steering with pool weights (non-uniform distribution)
# Pool canary: weight 10 (10% of traffic)
# Pool stable: weight 90 (90% of traffic)
# Useful for rolling out new code versions

Dynamic Steering

Dynamic steering uses real-time latency and pool health data to route each request to the fastest available pool. Cloudflare measures latency between every edge data center and every pool, then routes to the lowest-latency pool that is healthy.

# Enable dynamic steering
curl -X PUT https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/{lb_id} \
  -H "Authorization: Bearer {api_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "steering_policy": "dynamic",
    "description": "Latency-aware dynamic routing"
  }'

# Cloudflare measures latency every 60 seconds per edge location
# Check current latency data for pools
curl -s https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/pools/{pool_id} \
  -H "Authorization: Bearer {api_token}" | jq '.result.latency'

# Returns per-cloudflare-data-center latency measurements in milliseconds

FAQ

{{< faq "Which steering policy should I use for GDPR Compliance?">}} Use geo steering. It lets you route visitors from specific countries to pools in approved regions, ensuring data stays within jurisdictional boundaries. {{< /faq >}}

Does random steering respect pool health status?

Yes. Cloudflare only routes traffic to healthy pools regardless of the steering policy. If the randomly selected pool is unhealthy, the request is routed to another healthy pool.

Can I combine multiple steering policies?

No. You select one steering policy per load balancer. However, you can create multiple load balancers with different policies for different DNS records or subdomains.

Practice Questions

  1. What is the difference between geo steering and proximity steering?
  2. When would you use random steering with weighted pools?
  3. How does dynamic steering measure latency between edge locations and pools?

Summary

Cloudflare Load Balancing offers five steering policies: standard (default latency), geo (country-based), proximity (distance-based), random (even distribution), and dynamic (real-time latency). Each policy serves a different use case from data residency Compliance to canary deployments. Choose the one that matches your traffic routing requirements.

Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro — security-first tools for the modern web.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro