How Load Balancing Works

Added by Gaurav Joshua Vaz , last edited by Gaurav Joshua Vaz on Jan 22, 2008  (view change)
Tags: 

An overview of how the Load Balancing feature on the system works.

Summary

The load balancing (LB) feature distributes client requests sent to the system across several servers to optimize resource utilization. In a real-world scenario, a limited number of servers can provide service to a large number of clients. The servers can become overloaded causing a decrease in their performance. The system selects the server using the load balancing criteria and forwards the incoming client requests to it. Thus, the system balances the load on the servers.

The LB feature enables the system administrators to define a virtual server consisting of multiple servers in a server farm. The virtual server identifies the server using the load balancing criteria and directs incoming client requests to it. When a client initiates a connection to the server, the virtual server terminates the client connection and initiates a new connection with the selected server to perform load balancing. The LB feature provides traffic management from layer 4 (TCP and UDP) to layer 7 (FTP, HTTP, and HTTPS). HTTP is layer 7 awareness of a layer 4 protocol (TCP).

The system uses a number of algorithms, called LB methods, to determine how to distribute load among the servers. The default LB method is the Least Connections method.

A typical LB deployment consists of the entities described in the following figure.


 LB architecture

The entities that you must configure in a typical LB setup are:

Virtual server (vserver). A vserver is an entity that is represented using an IP address, a port, and protocol. The VIP is the vserver IP address that is usually a public IP address. The client sends connection requests to this IP address. The vserver represents a bank of servers.

Service. A service is an entity that is represented using an IP address, a port, and protocol. The services are bound to the vservers.

Server Object. A server object is an entity that is created when you create a service. The IP address of the service is taken as the name of the server object. You can also create a server object and create services using the server object.

Monitor. A monitor is an entity that tracks the health of the services. The system periodically probes the servers using the monitor bound to each service. If a server does not respond within a configured response timeout, and the configured number of probes fail, the service is marked down. The system then performs load balancing among the remaining services.

To configure LB, you must first create services. Then, you must create vservers and bind services to the vservers. By default, the system binds a monitor to each service. You can also assign weights to a service, and the LB method uses the assigned weight to select a service.

You can enable a system option to maintain persistent connections between clients and servers. (This option is used in e-commerce.) You must configure persistence on a vserver if you want to maintain the state of connection on the server. The system selects a server to process a client request and forwards all subsequent requests to the selected server.

You can also specify persistence for a group of vservers. When you enable persistence on the group, the client requests are directed to the same selected server regardless of which vserver in the group receives the client request. When the configured time for persistence elapses, any vserver in the group is selected for the incoming client requests.

More Information