[Ilugc] How does load balancing work?

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Sat, 2 Jun 2012 17:05:38 +0530

There are multiple kinds of load balancers.

Multiple levels of load balancing.

It can be at layer 2, it can be at layer 7 or it can be one of the
several other possibilities.

Load balancing involves promising a 100% uptime for a server application.

The server application could be a web server, mail server, database
server, CVS server,
 Windows file sharing server anything.

The load balancing idea is from the data center hosting world but it
can very well be used in a
 tightly controlled local environment.

It is not unusual for software to crash, for hardware to lose life and
of course for power to go away.

In such situations we can always fail over to another setup in which
the same application is available.

If you are using VPN technology this failover can be made worldwide
using a remote setup.

Then it is called as DRS or something.

Okay now let us take a look at a typical scenario.

If your firewall/router fails what do you do?

You are in a soup.

If your ISP WAN load balancer fails what do you do?

You are in a soup.

If your DB server goes down again, yes you are in a soup.

So what gives?

It is possible to do failover or service redirection in a variety of ways.

It can be made application independent, it can be application
dependent, it can be stateless or with state.

Many different ways exist.

But for the most common case, CARP or common address redundancy
protocol would do.

This is an adaptation of the Cisco VRRP protocol in which a virtual IP
address maps to a master
 and a slave IP address.

If you ping the CARP IP, one of the machines in the CARP cluster will respond.

Yes, clustering is a concept related to all this again from a data center world.

You can also do load balancing in the layer 7 in which an application
is redundancy aware.

Or simple DNS round robin or whatever else.

You can redirect HTTP requests using cookies or header patterns.

You can do what is known as DSR which is a direct server return in
which the routing is
 asymmetric.

Packets reaching the server and on the way back follow different routes.

This is not recommended but may be useful.

Definitely for NAT and address rewriting like port forwarding to work
routing has to
 be symmetric.

Most of the problems I have faced in my networking career are due to
asymmetric routing
 in a local LAN.

-Girish

-- 
Gayatri Hitech
http://gayatri-hitech.com

Other related posts: