Load Balancing Your Web Server

Have you ever been given the challenge of load balancing your Web servers? You can accomplish this task in several ways, ranging from the simple and inexpensive to the complex and costly. Which way is best for you depends on what type of content you're serving.

The simplest load-balancing method uses DNS round-robin. The concept is simple: Your DNS administrator fills the domain tables with multiple address records (called A records) that have the same host name but point to one or more IP addresses that serve the same Web content. As the DNS request is looking for your DNS server, the Web server responds to the client with the next address from the list. The client uses that DNS address for as long as the Time to Live (TTL) value that you assign in that domain's zone file (i.e., a file that contains all the DNS records and configuration files for that DNS domain). You can optionally assign specific TTL values to individual records as well.

Cost might make this approach attractive, but it has several drawbacks. One drawback is that DNS has no idea whether the Web server is answering properly. DNS isn't sensitive to the state of your Web server and will continue to direct users to your server even if it's down. The other problem is that this method works only for relatively static content. If you use dynamic content and code where a session must be maintained when you open it, then round-robin isn't for you.

The second method is to use Network Load Balancing Service (NLBS), called Windows Load Balancing Service (WLBS) in Windows NT 4.0. NLBS is a software-based load-balancing service that requires you to configure multiple IP addresses on each server. Although the software has a single-card method, I strongly recommend that you use two NICs for simpler setup and management. This service regularly checks each server in the cluster to ensure that it's up. If a server goes down, that server fails the check, and the rest of the cluster will recover after dropping the failed server. One drawback of NLBS is cost: Each server must run either NT Server, Enterprise Edition or Windows 2000 Advanced Server (AS). NLBS doesn't monitor specific services, such as IIS, WINS, or DNS services, so if a service fails but continues to run, NLBS won't detect it. I've used this service reliably for about a year now and have had good luck (and uptime) with it.

A third method is to use a hardware solution for load balancing. Cisco's Local Director is a perfect example of such a solution. The Local Director lets you set up a virtual server that can bounce requests to one or more Web servers behind the Local Director. Probes, which monitor the health of servers in the background, can sound the alarm for a failed server or IIS service and redirect requests to the remaining Web servers. As you might suspect, this approach is costly, but it gives you the ability to redirect in case of service failure.

Another hidden cost of these solutions includes the cost of making sure the content is replicated among the servers. I've used NSI Software's DoubleTake for this solution. It is a solid product you can rely on, but it's a bit pricey. Next time, I'll discuss how fault tolerance affects load balancing.

Discuss this Article 6

chandra (not verified)

on Dec 12, 2002

I would like to know what acctully happens to the user and the session that is connected to a web/app server. I guess the connection is broken and the user will have to relogin/connect. Is this dependant the Load balacner used or type of High availabilty or OS used.

There are some settings that you have to use, when a user opens a session, it has to stay on that server, pending on the settings, the user connects to an other server when he loads another page and losses his session with the first server...maybe that's what happening

We are doing load balancing on our server using double take. We are using IIS, sql server 2000, and cold fusion. When we added load balancing using double take, our web pages started hanging up. Any idea which part is causing the problem?
Thanks for any help.

Related Articles

John Savill's Hyper-V Master Class

Join John Savill for 12 hours of comprehensive Hyper-V training. This master-level online training course will explore all the key aspects of a Hyper-V based virtualization environment covering both current capabilities in Windows Server 2012 R2 and looking at the future with Windows Server vNext.