Partager via


What Is Network Load Balancing?

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

What Is Network Load Balancing?

In this section

  • Common Scenarios for Network Load Balancing

  • Technologies Related to Network Load Balancing

  • Interacting with Other Technologies

  • Related Information

For most Information Technology (IT) departments, Internet servers must support applications and services that run 24 hours a day, 7 days a week, such as financial transactions, database access, and corporate intranets. In addition, network applications and servers need the ability to scale performance to handle large volumes of client requests without creating unwanted delays.

Network Load Balancing clusters enable you to manage a group of independent servers as a single system for greater scalability, increased availability, and easier manageability. You can use Network Load Balancing to implement enterprise-wide scalable solutions for the delivery of Transmission Control Protocol/Internet Protocol (TCP/IP) based services and applications.

Network Load Balancing has many advantages over other load balancing solutions that can introduce single points of failure or performance bottlenecks. Because there are no special hardware requirements for Network Load Balancing, you can use any industry standard compatible computer in a Network Load Balancing cluster.

Network Load Balancing works by distributing client requests across a set of servers. It is particularly useful for ensuring that stateless applications, such as Web pages from a server running Internet Information Services (IIS), are highly available and can be scaled out by adding additional servers as the load increases. The ease with which Network Load Balancing allows you to replace a malfunctioning server or add a new server provides scalability.

Network Load Balancing offers the following benefits:

Scalability

Network Load Balancing supports up to 32 computers in a single cluster. Hosts can be added and removed without interrupting cluster availability.

Load balancing

Load-balances multiple server requests, from either the same client, or from several clients, across multiple hosts in the cluster.

Increased availability

Automatically detects and recovers from a failed or offline computer and balances the network load when hosts are added or removed. Recovers and redistributes the workload within seconds.

Many enterprise solutions must address client access to services and applications that are based on connections to selected TCP/IP addresses, protocols, and port numbers. For example, IIS provides service to clients on IP (TCP, 80). If this single IP host were to fail or become overloaded, client access to the service or application may be prevented or fall below a designated performance level.

Configuring multiple hosts to increase scalability and availability for applications and services is one solution. However, this solution may involve specialized network hardware, complex network configuration, and management of individual hosts. For example, multiple hosts functioning as Web servers, each with an individual IP address, could be resolved by multiple entries in round robin DNS. Each server is independent and if a server fails, the static load balancing provided by round robin DNS may prevent clients from accessing their Web application.

To resolve client connection problems, Network Load Balancing allows multiple computers or hosts, configured in a logical group called a network load balancing cluster, to respond to client connection requests made to a single virtual IP address.

Network Load Balancing Driver

Network Load Balancing is a driver, Wlbs.sys, which you must load on each host in the cluster. Wlbs.sys includes a statistical mapping algorithm that the hosts of the cluster collectively use to determine which host handles each incoming request.

You install the driver on each of the cluster hosts, and you configure the cluster to present a virtual IP address to client requests. The client requests go to all of the hosts in the cluster, but only the mapped host accepts and handles the request. All of the other hosts in the cluster drop the request.

Network Load Balancing Cluster Configuration

After the driver is installed, it must be configured before the host can join a cluster. You must configure three groups of information about each host: cluster parameters, host parameters, and port rules, before it is possible to create or join a cluster. Configuring the driver allows you to:

  • Select the cluster virtual IP address option.

  • Customize the cluster according to the various hosts’ capacities and sources of client requests.

  • Specify that one host handles all of the client requests with the others serving as failover alternatives.

  • Divide the load of incoming client requests among the hosts evenly or according to a specified load partitioning weight.

Common Scenarios for Network Load Balancing

This section includes scenarios representing common implementations of Network Load Balancing.

IIS Server (Web Farm)

An IIS Server Web farm is the most common scenario for Network Load Balancing. Below are two examples of how Network Load Balancing can be used to service a Web farm.

Servicing Multiple Web Sites

A Network Load Balancing cluster can be used to host multiple Web sites with different IP addresses. To do this, enter the additional IP addresses as you create the cluster. Additional IP addresses can also be added to an existing cluster.

The virtual cluster feature for Network Load Balancing (available in Windows Server 2003) makes it simpler to service multiple Web sites. Using this feature, you can define port rules that apply to only one of the specific IP addresses that you add to the cluster or to all of the IP addresses.

Servicing a Web Site with Active Server Pages

Web sites that use Active Server Pages (ASP) can maintain session state across client connections. Network Load Balancing helps preserve client access to session information by ensuring that all TCP/IP connections from a single client are directed to the same cluster host.

There are, however, situations in which a client can connect with one cluster host, and then have subsequent connections load-balanced to different hosts. Such situations include the following:

  • A host is added to the cluster, and Network Load Balancing load-balances new connections from this client to the host.

  • Multiple client-side proxy servers cause multiple connections from the same client to originate from different IP addresses.

If either of the preceding situations arises, ASP applications must provide a means to retrieve and manage session state even if a client connects to multiple cluster hosts as part of a single session. The following are two strategies for addressing this issue:

  • Use a means at the ASP level, such as a cookie, to retrieve the ASP client state across the Network Load Balancing cluster hosts.

  • Encapsulate in a client-side cookie the state from a specific client request. The cookie gives the server the context for subsequent client requests. This solution works only if there is a relatively small amount of state associated with each client transaction. As state grows larger, it becomes increasingly difficult to have the client forward a large cookie to the server with every request.

Virtual Private Network

Network Load Balancing can be used with virtual private network (VPN) servers to load-balance PPTP clients. To ensure compatibility with clients running earlier versions of Windows, such as Windows 98 and Windows NT 4.0, it is important to configure the TCP/IP properties correctly. To do this, assign only a single virtual IP address (the cluster’s primary IP address) to the network adapter used by Network Load Balancing. Do not assign a dedicated IP address on any network adapter on this subnet. This restriction does not apply for Windows 2000 or Windows Server 2003 clients. Assigning only a single virtual IP address to the network adapter used by Network Load Balancing ensures that network traffic returning from the host to the client originates from the virtual IP address to which the client sent the request.

Single-Server Failover Support

Although you can use Network Load Balancing to provide failover support for applications, using a server cluster is the preferred solution for this scenario. However, if you choose to achieve failover support with Network Load Balancing, this section describes how to do this.

You must first start the application on every host in the cluster. Network Load Balancing does not restart an application on failover. It assumes that an instance of the application is running on each host in the cluster.

In order for Network Load Balancing to provide failover support for a specific application, the files that the application uses must be simultaneously accessible to all hosts that run the application. To achieve this, these files should reside on a back-end file server.

Some applications open shared files only on client request. For these applications, using Network Load Balancing for failover is possible. However, other applications require that these files be continuously open exclusively by one instance of the application. Because this is not possible with Network Load Balancing, you must instead use server clusters to provide failover support for these types of applications.

Network Load Balancing is one of three Windows Clustering technologies. In addition to Network Load Balancing, there are server clusters and Component Load Balancing.

Server clusters

Server clusters are used to ensure that stateful applications such as a database, for example, SQL Server, can be kept highly available by failing over the application from one server to another in the event of a failure. Multiple servers (nodes) in a cluster remain in constant communication. If one of the nodes in a cluster is unavailable as a result of failure or maintenance, another node immediately begins providing service (a process known as failover). Users who access the cluster are constantly connected to server-based resources.

With Windows Server 2003, Enterprise Edition, and Windows Server 2003, Datacenter Edition, you can configure server clusters in one of three available cluster models, depending on your requirements.

Network Load Balancing load-balances requests between front-end Web servers and server clusters does the same thing for back-end database access. Network Load Balancing and server clusters cannot both be active on the same computer since both technologies control and configure network adapters and they may interfere with one another. By joining Network Load Balancing and server clusters together, an overall clustering scheme is created, as shown in the following diagram:

Integrated Clustering Scheme Using Network Load Balancing and Server Clusters

Integrated Clustering Scheme Using NLB and Cluster

Component Load Balancing

Component Load Balancing is the dynamic load balancing feature of COM+. It enables the creation of 8-node application clusters behind a Component Load Balancing router, enabling the COM+ applications to scale while also ensuring their constant availability. Component Load Balancing is ideal for stateless COM+ applications. Component Load Balancing is a feature of Microsoft Application Center 2000. It is not a feature of the Windows Server 2003 family.

Interacting with Other Technologies

Network Load Balancing interacts with the following technologies:

Terminal server clusters

Network Load Balancing can be used to load-balance terminal server clusters. Load balancing pools the processing resources of several servers using the TCP/IP networking protocol. You can use this service with a cluster of terminal servers to scale the performance of a single terminal server by distributing sessions across multiple servers. Session Directory (included in Windows Server 2003, Enterprise Edition, and Windows Server 2003, Datacenter Edition) keeps track of disconnected sessions on the cluster, and ensures that users are reconnected to those sessions.

DNS resolution

Network Load Balancing does not support dynamic Domain Name System (DNS) resolution, where the name of the cluster is automatically registered by the host when the host starts. This functionality must be disabled on the Network Load Balancing interface for both DNS and Windows Internet Name Service (WINS); otherwise, each host’s computer name will be registered with the cluster IP address. When using Network Load Balancing with DNS, you will need to directly configure the DNS server to register the name. Also, Dynamic Host Configuration Protocol (DHCP) should not be used on the network interface to which Network Load Balancing is bound; however, DHCP can be used on other interfaces.

L2TP/IPSec

Network Load Balancing in Windows Server 2003 supports both Point-to-Point Tunneling Protocol (PPTP) and Layer Two Tunneling Protocol (L2TP) virtual private network (VPN) sessions. However, Network Load Balancing must be configured in single affinity mode.

Kerberos authentication

Network Load Balancing supports Kerberos with applications it load-balances.

.NET Framework remoting

Network Load Balancing supports .NET Framework remoting, which uses method invocations from client to server over a single TCP connection. This means that once a connection is established, it is reused for subsequent method invocations and is closed only after the connection remains idle for a pre-configured amount of time. Network Load Balancing can load-balance these connections, but load balancing will likely be uneven because it is the TCP connection that is load-balanced and not the method invocation. Since one client gets “pinned” to a specific server, the load will be well distributed only if you have many clients connected to the cluster at the same time. Each client will get load-balanced, but the connection will stay open for a long period of time.

The following resource contains additional information that is relevant to this section.