Introducing Load Balancing & Intelligent Failover with Cloudflare

by Matt Silverlock.

Cloudflare's Enterprise customers have been using our Load Balancing service since March, and it has been helping them avoid website downtime caused by unreliable hosting providers, Internet outages, or servers. Today, we're bringing Load Balancing to all of our customers.

Even the best caching can't escape the fundamental limitations on performance created by the speed of light. Using Load Balancing, Cloudflare's customers can now route requests between multiple origins, allowing them to serve requests from the closest (and fastest) geographic location.

The Cloudflare Load Balancer automatically sends you notifications when things fail, and when they come back up again, so you can sleep well at night knowing we are keeping your website or API running.


If a DDoS attack can bring down your DNS provider or load balancer, it doesn't matter whether your servers are healthy or not. Our load balancing service runs in Cloudflare's 110+ datacenters, and with experience dealing with some of the largest DDoS attacks, we can withstand traffic volumes that smaller providers, virtual machines or hardware appliances can't. This also allows us to help you avoid business-impacting downtime when major cloud compute providers have issues: when we identify a connectivity reaching your application on AWS, we can fail over to your backup infrastructure on Google, a different region, or on-premise servers, and keep your site up and your customers happy.

Further, when proxying traffic through Cloudflare, you immediately benefit from faster failover responsiveness. In building Load Balancing we took a careful look at the existing global load balancing solutions on the market, and found that many rely on DNS to reroute traffic. Cloudflare will work as a DNS load balancer for non-proxied traffic (gray clouded in your DNS control panel) but works as an active proxy with near instant failover for proxied traffic. This means you don’t have to wait for TTLs to expire for traffic to shift.

We know from experience that it's common for a DNS change to take at least 60 seconds to propagate, even when everything is configured perfectly. Sixty seconds can represent thousands of failed requests, frustrated customers and lost sales. Cloudflare’s Load Balancer can reroute proxied traffic almost instantly, giving you the benefits previously reserved for on-premise load balancers but in the cloud.

Even customers with a single origin can benefit from Cloudflare’s Load Balancer. The product includes active and passive monitoring that will now alert you if we have trouble reaching your origin. Cloudflare’s position actively monitoring our customers’ traffic means we can let you know much more quickly than other monitoring services when your site is experiencing a problem

Valérian Saliou, Chief Technology Officer at Crisp, is using Cloudflare to geographically route WebSocket traffic: "When we rolled out Cloudflare Load Balancing to route traffic across our atlas of websocket servers, we immediately got messages from customers in Asia and Oceania thanking us for the improvement."

How Can I Get Started with Load Balancing?

So where do you go from here? You can enable Load Balancing in the Traffic app of your Cloudflare dashboard. We've put together a tutorial on how to get started with failover & health checks between multiple servers.

We want load balancing to be available to everyone. For that reason, Load Balancing starts at $5 per month, and includes 500,000 DNS queries each month (enough for the vast majority of sites).

Setting up a Load Balancer only takes a couple of minutes, and Load Balancers can easily be shared across multiple sites on Cloudflare, avoiding the need for repetitive configuration.

If you want to understand more about Load Balancing on Cloudflare, visit our product page or take a dive through our help articles.

comments powered by Disqus