4 ms·
Really he's talking about layer 4 load balancing, not 3, and assuming your juniper router has an Internet Processor II ASIC to juggle tcp flows. You're still bu
by peterwwillis 12y ago
Really he's talking about layer 4 load balancing, not 3, and assuming your juniper router has an Internet Processor II ASIC to juggle tcp flows. You're still buying hardware to do the load balancing, you just use software to do the BGP announce.
Honestly it all seems a bit crude and unreliable. If i'm writing a software load balancer i'm not going to use curl, bash scripts and pipes to do it. But this is why devops people shouldn't be designing highly available traffic control software.
- mprovost 12y agoIt's a cool hack because you probably already have bought the hardware to do this. Most decent switches these days can run BGP (or at least OSPF, which is capable of the same thing). And switches are usually way cheaper than hardware load balancers, at least per-port. Sure it's not perfect but for a startup trying not to spend a lot it can get you pretty far.
- peterwwillis 12y agoI don't know. From an infrastructure perspective I don't like the idea of having too many eggs in one basket, like combining the router/switch with the lb vips. Ideally you'd get a couple commodity boxes and configure them with LVS or pfsense or something. That way things like maintenance and access control of different parts of your network are separated based on the resource, and stability of one component won't necessarily affect another. It would also probably be cheaper to buy a couple servers than buy a couple routers/switches for redundancy.
- mprovost 12y agoRight, but you already have to buy two switches for redundancy right, what else are you going to plug those servers into? I get what you're saying about stability etc but BGP is a core function of a networking operating system. I do agree that this is not a typical setup and probably not for everyone but it is a clever use of existing protocols which made for an interesting read. I think for some people it could solve a real problem until they have time to do something better.
- phil21 12y agoYou're not understanding how this works at all. Your router/switch doesn't "combine" the vips. Ignore the running of bgpd on the webserver - that's really an extremely specific use-case that is not useful for most folks. However, imagine your scenario where you have two routers, two switches, and two load balancers configured in failover (LVS per your example) - with webservers behind that stack. Now you need more than a single load balancer worth of capacity? How do you scale it? Generally, you're pretty much stuck doing DNS RR to load balance across VIPs, and you add at least one VIP per load balancer you have. Need to do maintenance? Good luck not directing traffic to the load balancer you want to take out of service :) You can wait 3 days for all the DNS caches in the world to purge, or you're going to be killing sessions when you fail that VIP over. Now consider instead running BGPd vs. DNS RR. You have a single VIP, and as many load balancers as you like. I enjoy HAProxy, so I'll use it here. haproxy01 1.1.1.1 haproxy02 1.1.1.2 haproxy03 1.1.1.3 All these machines advertise the VIP to the switch they are connected to. You set up path cost on your network so all these VIPs share an equal cost at your routers, and your router will ECMP to each. Doesn't matter what switch or rack your HAProxy box is connected to in your network (I suggest paying attention for traffic management reasons) - as long as it can speak BGP to the switch/router, the traffic flows. Need to do maint? Kill bgpd on one of the HAProxy boxes. Current sessions stay up, you go get a coffee, and when you come back you have an empty session table and are free to do whatever you like to the machine. Turn it back on by starting up bgpd, and watch your traffic instantly rebalance. You are completely correct that if you don't need more than one (in a pair for HA) load balancer worth of capacity, this solution is likely overkill. But once you need to start scaling, you're quickly going to learn that it will either be prohibitively expensive, or come with lots of downsides. There pretty much are no downsides to this architecture, other than needing someone with a small amount of clue to operate it.
- staunch 12y agoYou don't know about keepalived or something? Your wait 3 days example is actually just bring the VIP up on another haproxy in one second. You can get essentially identical behavior like this. Kill keepalived and other box takes over IP instantly. VRRP.