0

Im setting up load balancing for my website and came across thispost about stackoverflow's infrastructure

https://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/

It seems like I will need 2 load balancing servers in case one of them goes down, but how is it configured on the domain/dns side?

If the domain's A record points to load balancer 1's IP, how can traffic reach load balancer 2? or am I missing something?

1 Answer 1

0

The two load balancers each have their own IP address(es). In addition you use something like keepalived (VRRP) or the *BSD variant CARP to have the load balancers agree on a virtual IP that at any time one of them is allowed to listen on (with the other one acting as a backup). This virtual IP address is what you point at in your DNS.

This way one of your LB nodes can go down and if everything works as it should, traffic will almost immediately start flowing through the other one.

Depending on how your service, you may need to synchronize session information between the load balancers, or you may simply be OK with clients establishing new sessions through the other LB in case of a failover.

4
  • can I config CARP on the switch to the web servers directly? (instead of the additional load balancing servers)
    – Josh
    Feb 21, 2019 at 19:16
  • There’s no technical reason why a sufficiently advanced switch stack couldn’t provide that service, but that’s not a product category I would claim to know anything about.
    – Mikael H
    Feb 21, 2019 at 21:28
  • just curious why stackoverflow needed the HAproxy servers when a switch that supports CARP should do the job - wonder if there are any benefits
    – Josh
    Feb 21, 2019 at 22:51
  • Network equipment that supports VRRP or similar usually does so to provide high availability for itself, not for things connected to it. Think two routers in a pair, rather than two web servers behind these routers. A load balancer has the ability to add advanced logic to the routing of client connections to servers in a way that quite simply isn't the task of a switch to handle. Also, when designing a solution you want to keep it as simple as possible. Adding the requirement of LB troubleshooting into your low-level network infrastructure definitely does not simplify things.
    – Mikael H
    Feb 22, 2019 at 3:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .