Origin steering options
- Random: Sends requests to origins purely based on . Distributes traffic more accurately, but may cause requests from the same IP to hit different origins.
- Hash: Cloudflare sends requests to origins based on a combination of and previous requests from that IP address. Ensures requests from the same IP address will hit the same origin, but actual traffic distribution may differ from origin weights.
By default, all origins within a pool have a weight of 1.
If you leave each origin with the default setting and choose a Random origin steering policy, each pool will receive the same percentage of traffic. If you were to use a Hash policy, that percentage will vary based on the IP distribution of your requests.
To customize weights when you , set the Weight to a number between 0 and 1 (expressed in increments of .01). Cloudflare will then send traffic to that pool based on a combination of your origin steering policy and the following formula.
% of traffic to origin = origin weight ÷ sum of all weights in the pool
Origin weight example
Here’s an example applying weights to three origin servers with a Random origin steering policy:
- Weights: Origin Server A = 0.25; Origin Server B = 0.25; Origin Server C = 0.50
- When all origins are healthy, each origin will receive the following proportion of total traffic: A = 25%; B = 25%; C = 50%.
- When one origin is unhealthy (such as origin C), each healthy origin will receive the following proportion of total traffic: A = 50%; B=50%.
A significant amount of traffic is required for the distribution to converge on the expected values.
An origin with a weight of 0 should not receive any traffic sent to that pool (though the origin will still receive health checks).
You can also see this value in the Percent field when creating or editing a pool in the dashboard.
Additionally, session affinity takes precedence over any selected weight or origin steering policy.