Web-server – redundant http load balancer

load balancingweb-server

Got a simple scenario with two web servers for redundancy and to scale.

But how do I make a two web-server setup fully redundant? I can think of two solutions;

  1. two web servers, one load balancer spreading the load. one extra machine for the load balancer. but how will the load balancer be redundant?

  2. two machines, each running the web server AND running a load balancer, spreading the load over. have a DNS entry point to both of the machines. no extra machines needed for load balancing.

How do you guys normally solve this kind of problem?

Best Answer

But how do I make a two web-server setup fully redundant?

Typically, you do not. Making the database fully redundant with seamless failover is hard. And full redundancy requires additional hardware, so it's often not implemented before the site grows to be a bit larger.

You must think about session state -- user login state, shopping cart contents, etc. How will this be handled?

If your service is completely state-less (fx static file serving with no customization for each user) then you could just use DNS Round Robin to publish 2 IP addresses for your site, one for each server.

If you need a little more control over how fail over is handled, you could consider 2 web servers, both sharing the same IP address through Windows NLB or on Linux using something like Linux-HA, Keepalived, etc (there are several possible solutions).