A load balancer distributes traffic among origin pools according to pool health and its steering policy. Each load balancer is identified by its DNS hostname (
For suggestions, refer to Common load balancer configurations.
Load balancing and existing DNS records
For details about DNS records, refer to DNS records for load balancing.
HTTP keep-alive (persistent HTTP connection)
Cloudflare maintains keep-alive connections to improve performance and reduce cost of recurring TCP connects in the request transaction as Cloudflare proxies customer traffic from its edge network to the site’s origin.
Ensure HTTP Keep-Alive connections are enabled on your origin. Cloudflare reuses open TCP connections for up to 15 minutes (900 seconds) after the last HTTP request. Origin web servers close TCP connections if too many are open. HTTP Keep-Alive helps avoid premature reset of connections for requests proxied by Cloudflare.
When using HTTP cookies to track and bind user sessions to a specific server, configure Session Affinity to parse HTTP requests by cookie header. Doing so directs each request to the correct application server even when HTTP requests share the same TCP connection due to keep-alive.
For example, F5 BIG-IP load balancers set a session cookie at the beginning of a TCP connection (if none exists) and then ignore all cookies from subsequent HTTP requests on the same TCP connection. This tends to break session affinity because Cloudflare sends multiple HTTP sessions on the same TCP connection. Configuring the load balancer to parse HTTP requests by cookie headers avoids this issue.
Create load balancers
For step-by-step guidance, refer to Create a load balancer.
For an up-to-date list of load balancer properties, refer to Load balancer properties in the Cloudflare API documentation.
The Cloudflare API supports the following commands for load balancers.
|Create Load Balancer|
|Delete Load Balancer|
|List Load Balancers|
|Load Balancer Details|
|Overwrite specific properties|
|Overwrite entire Load Balancer|