|
Load Balancing on a Shoestring
If you
own or manage a high traffic or mission critical website then some
sort of load balancing solution should be implemented. A few ways to
implement a load-balancing network are: employing layer 4 routers, DNS
Round-Robin, and a Linux Virtual Server. Each of these should be
implemented for different situations and needs.
A layer 4 router
operates at the Transport Layer of the OSI model. This means that it
operates above the IP layer which is contained in layer 3. Basically
what happens with a layer 4 router is that it disguises multiple
servers behind it to appear as if they were simply one server. This
effectively creates a high-availability cluster that allows for one
server to go down and be removed from the rotation without anyone from
the outside knowing.
There are several vendors of Layer 4 routers, however almost all of
them are extremely costly.
Foundry Networks ,
F5 Networks,
Cisco, and
Coyote Point all offer layer 4
routing solutions. To implement one of these solutions there are
several things that are needed to assure high availability. A layer 4
router, multiple front end web servers, and clustered or mirrored
database servers are all needed to provide an effective load balancing
solution with a layer 4 router. The downfall of this solution is its
prohibitive cost. These solutions are usually only obtainable by large
companies with big IT budgets.
A more affordable alternative to implementing a Layer 4 router is to
create a DNS Round-Robin. This type of load balancing is done at the
DNS server level as opposed to the router level. What happens is
multiple IP addresses of servers are entered into the DNS server. Then
when the first person loads a page they will get the first IP, the
second person will get the second IP, and so on. When the last server
is reached, then the DNS server starts again at the front of the list.
To implement a DNS Round-Robin load balancing solution, you need to
create multiple identical servers that have unique IP addresses. Then
list all the IPs in the zone file of the DNS server. Now the servers
will be called in a distributed fashion. This setup is much cheaper
than the Layer 4 router approach as it does not require a router that
can cost thousands of dollars.
Unfortunately the phrase “you get what you pay for” holds true on this
setup. A DNS round robin approach has many drawbacks. The first
drawback is that if any server goes down, a portion of the traffic
will still be sent to it and they will see a broken server. If a
server permanently goes out of commission it will take a while for it
to be completely removed from the loop due to DNS propagation times.
It is also not true load balancing since there is no way for DNS round
robin to control which server gets the next connection based on
knowledge of existing number of connections and load. The best
application for a DNS round robin is a high traffic static or
semi-static website.
Despite the problems with DNS Round-Robin, there is still a pretty
good solution for creating a load-balanced system on a budget. This
dream solution that merges both cost and high availability is called
the Linux Virtual Server. The Linux Virtual Server is a solution that
can turn a server using commodity hardware into a layer 4 router. One
of the advantages of this over using a layer 4 router from a major
vendor is that if any part dies it is relatively easy to replace in
minimal amounts of time. For instance, spare network cards, RAN etc.
are very common in datacenters but a spare proprietary interface card
is pretty rare.
To setup a Linux Virtual
Server ‘cluster’ you will need similar equipment that was required for
a layer 4 router. If you want a high availability setup, a distributed
database server is important. However, if the point of load balancing
in your organization is to simply add more bandwidth capacity to your
servers, then one database server may work fine. More information on
setting up a Linux Virtual Server can be found
here.
While the Linux Virtual Server may sound like an ideal solution, it
too has a few drawbacks. The biggest drawback is that it is a Linux
system acting as network hardware. Running a Linux machine at that
level requires some expertise, and you will need a knowledgeable
person on staff to manage this router. Luckily, most organizations
with the kind of website that requires load balancing do have a Linux
guru or two on the payroll.
There are several ways to create an effective load balanced network
for your website. Most of these have a few drawbacks such as price,
lack of robustness, and maintenance. If you are in charge of
maintaining a high traffic or mission critical website then one of
these three load balancing methods will probably work for your site.
by
Tyler Weaver
|
|
|