Web-server – IP Level Failover for Web Servers With BGP (Am I Insane?)

bgpipload balancingweb-server

I've considered using Round-robin DNS failover, but due to various levels of DNS caching, you run the risk of old records pointing to a down site.

If I own my own address space and AS number, in data centre 1, I can announce my 1.1.1.x/x network to the world from my router and everyone can hit the load balancer at 1.1.1.1, life is peachy. I could then have in another data centre, the same set up, and the router there also announces my IP space and AS number to a different upstream provider there. Users will obviously hit the closest set-up to them based on the AS-PATH and other metrics from BGP in their local ISPs network.

Now, lets pretend something terrible happens at data centre 1, and router 1 goes offline, my IP space and AS are no longer announce there, and all traffic will fall back to solely data centre 2, for traffic to 1.1.1.1 (load balancer). Do people do this, is this a ridiculous idea? Have I missed something blindingly obvious about why I shouldn't do this? Is this just not practical, or a genius plan?

Best Answer

It works fine. It just requires a lot more engineering work to make it go, you need routers, BGP connectivity, your own IP space, etc. I assume in your example above that you have data center 1 and 2 running all the time.

Many people do this fine, look up 'anycast' for what you're trying to do. The large problem with this is that it works much better for UDP based services (non-stateful). If you're downloading a large file via HTTP, and there's an outage on the router side, your traffic will go to the new 1.1.1.1, which has no idea what is going on, and will drop the connection.

Related Topic