Load Balance

Network Load Balancer(NLB) Network Load Balancer(NLB) is Microsoft's solution to load balance. Actually, it's one of three solutions for Windows Clustering solutions, but it's the one used for stateless applications like web servers. NLB users its own algorithm to balance the load across all of the servers, Incoming traffic is routed to all of the servers, but only one of them will actually handle the traffic while the others ignore the traffic. Therefore, it doesn't have any load-balancing device in front of the web servers,, All of the servers work together as peers, together for a share cause. NLB's main strengths are that it is easy to configure and set up, it's free since it is included in the OS, and it has enough features to handle many common web farm environments. It lacks some of the powerful features that the third-party hardware vendors have, but for straightforward web farms, it does an impressive job. A limit of 32 servers can be included in each NLB cluster, but see the next section(XXX) on DNS load balancing for a way to handle more than 32 server by using NLB and round-robin DNS load balancing together. Round-Robin DNS Load Balancing Another method for load balancing is called round-robin DNS load balancing(also known as a "poor man's load balancer"). To be true, it's not really balancing because it doesn't "balance" based on the load of the server. Instead, it sends each new request to the next server in the list regardless of the state of the server. In fact, it will continue to send traffic to servers even if they are partially or fully unavailable. Third-Party Load Balancing In contrast to NLB, which doesn't have a device out front, most third-party hardware devices sit in front switches will balance by IP and port, where Layer 7 switches will read inside of the network packets and distribute to the appropriate server. Layer 7 checking can distribute traffic by host header, cookies, text in the URL, SSL session ID, text in the page, or event the protocol. Layer 2 to 4 load balancing is relatively easy to do, and most reputable vendors can handle it with ease. Higher-end load balancers allow inspection at Layer 7(the Application layer). They dig into the packets and distribute the load based on information at that level. Because of the greater demands on the load balancer for Layer 7 load balancing, there is a drastic difference between vendors, separating the low-end vendors from the high-end vendors. In addition to Layer 7 load balancing, many Layer 4 switches will do health checking at the Layer 7 level. They can check the status of a page to watch for a status of 200, for example, to ensure that the page is functioning properly. Or they can dig further and check for particular words or patterns of characters on a page. If it fails any of its test, then it will take a server out of rotation and only send traffic to the fully functioning web servers. Different vendors call them by different terms, but some common affinity options include:

 Round-Robin -- Each request is assigned to the next server in the list in a round-robin fashion. 

 Weight-Based -- Each server is given a weight so requests are assigned to the servers in proportion to their weight. 

 Random -- Each request is randomly assigned to a server. 

 Sticky Session (Affinity) -- The load balance keeps track of the sessions and ensures that return visits within the time-out period always return to the same server Response Time -- The load balancer regularly queries the server and keeps track of the server that responds the fastest. It sends new requests to the server with the fastest response time. 

 Hash(Mixed)

posted on 2010-09-09 15:12  henry.zhen  阅读(856)  评论(1编辑  收藏  举报