|
Load BalancingHere are my notes on routing (distributing) work and ensuring high availability of servers. | Topics: |
|
The Trouble with Load Balancing
A load balancer may not evenly distribute load among machines in the cluster. This can happen for several reasons:
|
|
Approaches for High Server Availability
There are several basic types of load balancing:
Note: Although not necessary for production work, "Individual Pass-Though VIPs" are requested/defined so that for performance measurement and troubleshooting, individual servers can be reached through the load balancer. |
[2] $22 Server Load Balancing (O'Reilly, 2001) by Tony Bourke of Kemp Technologies describes (now obsolete versions of) several load balancers: F5's BIG-IP, Cisco's CSS, Alteon WebSystems, and Foundry ServerIron Series. |
Mechanisms
There are several distinguishing features among load balancers.
|
Load Balancing in the Cloud
The internal processes (life-cycle) of a "redundant, self-curing, and self-scaling" computing facility are
|
MS NLB ServicesAfter Microsoft acquired, in 1998, from Valence Research the "Convoy Cluster" component of Windows NT 4.0 Enterprise Edition, Microsoft introduced its Network Load Balancing (NLB) service as a free add-on service to Advanced and Datacenter versions of Windows 2000 Server (known as Enterprise Edition of Windows 2003). The acronymn for Windows Load Balancing Service (WLBS) is also the name of the utility which verifies whether load balanced hosts "converge":
wlbs stop wlbs start
MS-NLB works inside a server as a driver that intercepts traffic from the NIC card. NLB is "fully distributed" in that it is on all host servers serving a web site on a single subnet. Like other load balancers, clients make requests using a single primary virtual IP address (VIP) for the cluster. However, all incoming IP packets are received by the cluster adapter of each host because NLB assigns listening cluster adapter on each host with the same MAC address based on the VIP. One of the hosts on the public subnet sends a MAC-layer (Layer 2) multicast to hosts on the local broadcast subnet of the cluster through another adapter. These are received by a separate dedicated IP adapter on each host. The NLB service runs on every host as an intermediate driver between the TCP/IP (HTTP & FTP) protocol and network adapter drivers within the Windows 2000 protocol stack. The service ignores unwanted packets and doesn't reroute packets to individual hosts. Because potentially any host on the cluster can respond to a client, a Web browser may receive various images within a single Web page from different hosts on a load-balanced cluster. The host that responds to a request is the host which know that it's the default host. This is determined by the host priority number unique to every host. That number is in the range of 1 to 32 because that's the NLB product's limit on hosts per cluster. Each NLB server emits a heartbeat message to other hosts in the cluster, and listens for the heartbeat of other hosts. A host knows it's the default host if it doesn't hear another host with a higher priority. This allows any host to be taken offline (for preventive maintenance, upgrading, etc.) without disturbing cluster operations. Each host responds to requests through its own unique dedicated IP address so that other hosts know the source of the request. Traffic arriving through a cluster adapter is redirected to the dedicated IP address of a specific host. The dedicated IP address is always entered first on the list of IPs so that outgoing connections from the cluster host are sourced with this IP address instead of a virtual IP address. The load-balancing server uses its algorithm to choose the best available server for the client. To allow session state to be maintained in host memory, NLB directs all TCP connections from one client IP address to the same cluster host. This behavior is controlled by the client affinity parameter. Changing load percentages allow hosts with higher capacity to receive a larger fraction of the total client load. NLB doesn't take advantage of Win2K's performance information for load balancing. MS-NLB doesn't support delayed binding. Each server provides failover for every other server, thus the software provides load-balancing redundancy in an active-and-active implementation.
|
MS NLB Configuration
Use either the NIC properties page or the "Administrative Tools\Network Load Balanacing Manager" tool.
B. To use the "Administrative Tools\Network Load Balanacing Manager" wizard:
Click the "Host Parameters" tab to supply the dedicated IP address and subnet mask for the private interface.
On subsequent nodes, set the priority value to the next highest unused number.
To start a host:
|
BEA WebLogic HttpClusterServlet Proxy Plug-inWebLogic Servers are clustered for failover and load balancing within a particular Weblogic Server domain by being setup with the HttpClusterServlet by a Weblogic Administration server instance. Load Balancing in a Cluster, and Failover and Replication in a Cluster WebLogic Server maintains information about the "state" of jobs done on a server using session replication and replica-aware stubs. When a particular object unexpectedly stops doing its job, replication techniques enable a copy of the object pick up where the failed object stopped, and finish the job. WebLogic Server shares and maintains the availability and location of deployed objects using multicast, IP sockets, and JNDI communications Load Balancing for Servlets and JSPs Planning WebLogic Server Clusters Recommended 2-Tier Cluster Architecture or the Recommended Multi-tier Cluster Architecture serializable objects |
Overview of WebLogic 5.1 Server Clustering How BEA 5.1 Servlet Clustering Works describes HTTP session state servlet clustering in detail. BEA Weblogic 5.1 HTTP Session State Replication |
Load Balancing Hardware Appliances
Cisco CSS
|
Below is another example from this online article. Note the vertical bar (|) separating web servers:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc. //DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app> <servlet> <servlet-name>HttpClusterServlet</servlet-name> <servlet-class>weblogic.servlet.proxy.HttpClusterServlet</servlet-class> <init-param> <param-name>WebLogicCluster</param-name> <param-value>server1:7001|server2:7002</param-value> </init-param> <init-param> <param-name>DebugConfigInfo</param-name> <param-value>ON</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>HttpClusterServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>HttpClusterServlet</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>HttpClusterServlet</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>HttpClusterServlet</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> </web-app>
I also suggest these temporary settings which create a proxy log file under the default temp directory:
<init-param> <param-name>Debug</param-name> <param-value>ALL</param-value> </init-param>
Any changes made require the creation of a new war file, etc.
The weblogic.properties file contains these specifications to define clustering:
To prevent "convoying" — when one server is significantly slower than the others — the weblogic.system.weight property of each server is set for weight-based round-robin clustering of RMI EJB objects.
Load Balancing Products
"Application traffic management" providers:
|
|
|
More for Performance Engineers... | |
|
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Thank you!
Human verify: |