Rely on the Windows NT Load Balancing Service

WLBS uses clustering and load balancing to make server application reliable and scalable.

Ken Spencer

May 31, 1999

11 Min Read
ITPro Today logo in a gray background | ITPro Today

WLBS provides reliability and scalability

Web sites that rely on sophisticated server applications have two main problems: reliability and scalability. Users need reliable access to Web applications, including their organization's intranet applications. The increase in traffic on both Internet and intranet sites has contributed to the problem of Web application scalability. I've seen the traffic on my company's Web site go from 1000 hits per day to 80,000 hits per day. Using one server to provide reliability presents a problem because if the server goes down, the applications go down. In addition, one server provides a finite amount of scalability.

Web masters and systems administrators based the first reliability and scalability solutions on hardware devices such as the round-robin DNS router. The router randomly handed requests off to different servers on the network to provide load balancing. This method worked fine with the original HTML sites and even some sites that Web masters built with early Web applications. However, the router solution began to fall apart with the introduction of Web applications with more sophisticated features such as Internet Information Server (IIS) session support, which stores information on the server between a user's sessions. The router solution was unable to provide accurate load balancing necessary for mature Web applications and their features.

To address reliability and scalability, vendors developed software such as Valence Research's Convoy Cluster Software for NT Server. In late 1998, Microsoft acquired Valence Research and renamed this product Windows NT Load Balancing Service (WLBS) 2.2. WLBS is free to users of NT Server 4.0, Enterprise Edition. (To obtain WLBS, go to http://www.microsoft.com/ntserver/all/ downloads.asp#windowsntserverfeatures.) WLBS also runs on NT Server 4.0, Standard Edition, but it isn't licensed for this OS. The README file states, "When planning upgrades to Windows 2000, please note that WLBS will only work on Windows 2000 Advanced Server and Windows 2000 Datacenter Server." You need to have the correct NT version and license to run WLBS, and you must upgrade to the correct version of Windows 2000 (Win2K).

Highlights and Caveats
WLBS solves server applications' reliability problems through clustering, and scalability problems through load balancing. Clustering provides failover support. If one server goes down, the program routes users to another server. Load balancing distributes the user load across the servers and lets you add new servers on the fly. For more information about how WLBS can improve application performance, see the Microsoft article "Windows NT Load Balancing Service (WLBS) Provides Higher Scalability and Improved Fault Tolerance" at http://www.microsoft.com/ntserver/ ntserverenterprise/exec/feature/wlbs/default.asp.

WLBS turns several servers into a group, or cluster, of servers that supports TCP/IP applications and services to provide reliability and scalability. The cluster can run applications and services that include Web servers (such as IIS), streaming media services (such as Microsoft NetShow Services), VPNs, and proxy services (such as Microsoft Proxy Server). Although these examples are Microsoft software, WLBS supports third-party applications and doesn't limit you to Microsoft applications. WLBS and its services are transparent to applications because the product sits between the incoming TCP/IP traffic and the application.

WLBS doesn't work with non-IP software such as a database server, mail server, or COM objects that run on the server. You can use Microsoft Cluster Server with non-IP applications, then use WLBS for the TCP/IP applications to provide total fault tolerance for your system. You can place COM objects on each server in the cluster to obtain COM object failover support with WLBS. In this case, if a server fails, then WLBS routes requests for the IP application accessing the COM objects to another server in the cluster.

Figure 1 illustrates a user accessing a WLBS cluster from a Web browser. WLBS installs as a network adapter on each NT server in the cluster. The WLBS cluster configuration has a distinct domain name (e.g., myco.com) and IP address (e.g., 199.200.101.20), which give the cluster a unique identity. You install the WLBS drivers and use the cluster name and IP address for each cluster-member server. Users can use the cluster name or address to access a TCP/IP application on the cluster. Each server's cluster software sees the request and dynamically sends the message to the correct server based on a load-balancing algorithm.

Clustering for Reliability
The WLBS cluster can consist of 2 to 32 NT servers to provide the necessary failover support for server applications such as crucial Web applications. The systems participating in the cluster don't need special hardware, with the exception of network adapters. WLBS works best when you use at least two network adapters in each server. You can dedicate one network adapter to communicate with the other servers in the cluster (intra-cluster-server communication). You can use the other network adapter for external application communication with the server (e.g., for Web browsers). You can run WLBS on servers with only one adapter, but the software might not perform as well in some heavy-load situations as it does on a two-adapter system.

Intra-cluster-server communication includes a heartbeat message that each cluster server sends to the other servers. The heartbeat message lets the other servers know that each server in the cluster is working properly. The servers send the heartbeat at 1-second intervals by default. If the other servers in the cluster don't hear from a server for five heartbeats, the servers automatically initiate convergence.

Convergence is the process of resetting the state of the cluster systems and combining them into a new cluster. When convergence occurs, the systems in the cluster elect the system with the highest host priority as the default host. You set the host priority for the systems in the WLBS options. Several events can trigger convergence, such as failure of a cluster server, adding a new cluster server, or shutting down a cluster server. A cluster convergence takes less than 10 seconds from discovering the problem to completing the convergence operation. The event log of each server in the cluster generates an Event Detail (as Screen 1 shows), which notes convergence completion.

If users attempt to access a server during convergence, the server routes them to another server. Users will access this other server during the 10-second convergence time frame. If the users work in an application that doesn't track server users, the users can easily move to another server without interrupting their activities. If the application stores information on the server, redirected users must reenter the application on the new server. Applications that require a user to initially log on (e.g., e-commerce sites) track the user on the server and require the user to reenter the application.

Failover support is useful when computers are down for maintenance, upgrades, or repair. Because WLBS automatically routes users to other systems when a server goes down or offline, you can add systems to and subtract systems from a cluster dynamically. However, you must use some common sense with this approach. If you run data-driven applications in your cluster, you don't want to bring a system down when users are interacting with the database (e.g., entering orders). In this scenario, you might want to modify the application to show when users are updating a database and from what server they are performing the update. You need to make sure that users complete their transactions before you bring the server down. Because WLBS doesn't handle failover of the database servers, the systems that interact with the database (e.g., Web servers) are your primary concern. You can also build Active Server Pages (ASP) applications in which ASP automatically routes users to another server when you need to take down that application.

Load Balancing for Scalability
Load balancing is the other major service that WLBS provides to server applications. When you install WLBS, you can set the load-balancing parameters and set the priority for each server in the cluster. The server priority can range from one to the total number of servers in the cluster. The priority determines which server is the default host server when convergence occurs. This server is responsible for handling the cluster traffic that specific rules don't manage.

Screen 2 shows the Windows NT Load Balancing Setup dialog box that appears when you first install WLBS. To open this dialog box, select the Network applet in Control Panel, click the Adapters tab, select the WLBS Virtual NIC entry, and click Properties. When you make changes to WLBS's properties, such as Cluster parameters, Host parameters, or Port rules, you must restart the server.

Among the Port rules properties is a Filtering mode option, which controls how WLBS routes traffic to various hosts in the cluster. The default filtering mode is Multiple hosts. This mode automatically balances the TCP and UDP traffic to the cluster across all the systems in the cluster. When using the multiple-hosts mode, you can set the load percentage for a server to determine how the servers in the cluster share the application load. The default load percentage setting is equal, which forces each server in the cluster to share the load equally. You can change this value for each server in the cluster. The sum of the load percentages for all servers in a cluster doesn't have to equal 100, because servers can dynamically enter or leave the cluster. WLBS divides the server's load percentage value by the sum of the load percentages to dynamically compute the true fraction of traffic each server will handle. Systems administrators can use this calculation to fine-tune the cluster's server load. You can set a high percentage value on a major-horsepower server so the server receives most of the load. When you take the major server down, you can configure the other servers to share the load evenly or you can adjust the load percentage for the other servers.

Another setting you can change when using the multiple-hosts mode is the Affinity property. The Affinity property defines how the cluster routes requests from a client system. WLBS uses the Affinity property to assist in state management (i.e., storing user information on the server between user visits to the application).

When you build applications with ASP, you can use session variables to store information and maintain the user application's state between user visits to the application. The ASP engine sends a memory cookie to the user's browser to track session variables.

When you use session variables to handle state management, you need to set the Affinity setting to Single. The Single setting routes all requests from one IP address to the same server in the cluster. This routing lets IIS track the user's sessions and properly handle the user's requests. WLBS sets the Affinity property to Single by default.

A proxy server lets multiple clients use one IP address. This ability complicates the use of WLBS to route proxy server clients. WLBS recognizes clients that access the cluster through a proxy server as one user because of the IP address. For WLBS to handle session management with a proxy server, you need to change the Affinity setting to Class C when your clients come from networks that use proxy servers. WLBS with a Class C setting treats clients from the same subnet as one group and routes them to the same server in the cluster. As long as the proxy servers that clients use to access the cluster are in the same subnet, the Class C setting routes clients to the same server in the cluster.

You can also set filtering rules for each server in the cluster. Filtering rules specify how the servers in a cluster divide requests, based on the target port for the request. These rules provide more granularity to scheduling than using the load percentage provides. To define the rules, you specify the TCP or UDP port range, protocols, and the filtering mode that rules how the cluster handles the port range and protocol-defined traffic.

Tips and Reminders
When you install WLBS for the first time, you need to expand the files and review the installation notes in the wlbs.hlp file. I recommend that you review these notes before you use the software. When I tried to install WLBS, I needed to load the Setup files onto a 3.5" disk for Setup to find the files. Also, the software's white papers contain a wealth of information. For more information about the WLBS approach to load balancing, see Jonathan Cragle, "Load Balancing Web Servers," June 1998.

With WLBS, Web masters and systems administrators no longer need to rely on hardware solutions to make application servers more reliable and scalable. If a server goes down, the cluster routes users to other servers. The program also distributes the traffic across all the systems to load balance the servers in a cluster. WLBS provides parameter-based reliability and algorithm-based scalability that the former hardware workarounds didn't provide.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like