In computer networking, load balancing is a technique (usually performed by load balancers) to spread work between two or more computers, network links, CPUs, hard drives, or other resources, in order to get optimal resource utilization, throughput, or response time. Using multiple components with load balancing, instead of a single component, may increase reliability through redundancy. The balancing service is usually provided by a dedicated program or hardware device (such as a multilayer switch). The technique is commonly used to mediate internal communications in computer clusters, especially high-availability clusters.
Contents |
For Internet services
One of the most common applications of load balancing is to provide a single Internet service from multiple servers, sometimes known as a server farm. Commonly load-balanced systems include popular web sites, large Internet Relay Chat networks, high-bandwidth File Transfer Protocol sites, NNTP servers, DNS servers. For Internet services, the load balancer is usually a software program which is listening on the port which external clients connect to in order to access the service. The load balancer forwards requests to one of the "backend" servers, which usually reply to the load balancer. This allows the load balancer to reply to the client without the client ever knowing about the internal separation of functions. It also prevents clients from contacting backend servers directly, which may have security benefits by hiding the structure of the internal network and preventing attacks on the kernel's network stack or unrelated services running on other ports. Some load balancers provide the a mechanism for doing something special in the event that all backend servers are unavailable. This might include forwarding to a backup load balancer, or displaying a message regarding the outage. An alternate method of load balancing which does not necessarily require a dedicated software or hardware node, is called round robin DNS. In this technique, multiple IP addresses are associated with a single domain name (like www.example.org). Clients themselves are expected to choose which server to connect to. Unlike the use of a dedicated load balancer, this technique is "transparent" to clients, because it exposes the existence of multiple backend servers. The technique has other advantages and disadvantages, depending on the degree of control over the DNS server and the granularity of load balancing which is desired. A variety of scheduling algorithms are used by load balancers to determine which backend server to send a request to. Simple algorithms include random choice, and round robin. More sophisticated load balancers may take into account additional factors, such as a server's reported load, recent response times, up/down status (determined by a monitoring poll of some kind), number of active connections, geographic location, capabilities, or how much work it has recently been assigned. High-performance systems may use multiple layers of load balancing.
Persistence
One dilemma when operating a load-balanced service, is what to do if the backend servers require some information ("state") to be stored "persistently" (across multiple requests) on a per-user basis. This can be a problem if a backend server needs access to information generated by a different backend server during a previous request. Performance may suffer if cached information from previous requests is unavailable for re-use. One solution is to consistently send clients to the same backend server. This is known as "persistence" or "stickiness". One downside to this technique is lack of automatic failover, in case one or more backend servers should fail or be taken offline for maintenance. Persistent information is lost if it cannot be transmitted to the remaining backend servers. Assignment to a particular server might be based on a username, client IP address, or random assignment. Due to peculiarities such as DHCP, Network Address Translation, and web proxies (notably used by AOL customers), the client's IP address may change across requests, and so this method can be somewhat unreliable. Random assignments must be remembered by the load balancer, which creates a storage burden. If the load balancer is replaced or fails, this information can be lost, and assignments may need to be deleted after a timeout period or during periods of high load, to avoid exceeding the space available for the assignment table. The random assignment method also requires that clients maintain some state, which can be a problem, for example when a web browser has disabled storage of cookies. Sophisticated load balancers use multiple persistence techniques to avoid some of the shortcomings of any one method. An alternate solution, is to give all backend servers access to all per-user data. This might be accomplished by a networked filesystem or a networked relational database. Depending on the implementation, this may introduce a new single point of failure, which may undermine reliability. The need to transmit more information between servers may also negatively impact performance and security.
For web sites
|
|
This article or section needs to be updated. Parts of this article or section are no longer up to date. Please update the article to reflect recent events, and remove this template when finished. |
|
One major issue for large Internet sites is how to handle the load of the large number of visitors they get. This is routinely encountered as a scalability problem as a site grows. There are several ways to accomplish load balancing; an example of a site using the approach is the Wikimedia Foundation and its projects. In June 2004 the load was balanced using a combination of:
- Round robin DNS distributed page requests evenly to one of three Squid cache servers.
- Squid cache servers used response time measurements to distribute page requests between seven web servers. In addition, the Squid servers cached pages and delivered about 75% of all pages without ever asking a web server for help.
- The PHP scripts which run the web servers distribute load to one of several database servers depending on the type of request, with updates going to a master database server and some database queries going to one or more slave database servers.
Alternative methods include use of layer 4 routers, and for Linux, the Linux Virtual Server, which is an advanced open source load balancing solution for network services. Other load balancing reverse proxies for UNIX systems include XLB, HAProxy, Balance, Pen and Pound. With the appropriate modules, the Apache, Lighttpd and Nginx web servers can also act as a reverse proxy. Fastream IQ Reverse Proxy is a scalable and robust reverse proxy for Windows 2000/XP/2003/Vista. Network Load Balancing Services is a proprietary Microsoft clustering and load balancing implementation.
Load balancer features
Hardware and software load balancers can come with a variety of special features.
- 'Asymmetric load: A ratio can be manually assigned to cause some backend servers to get a greater share of the workload than others. This is sometimes used as a crude way to account for some servers being faster than others.
- Priority activation: When the number of available servers drops below a certain number, or load gets too high, standby servers can be brought online
- SSL Offload and Acceleration: SSL applications can be a heavy burden on the resources of a Web Server, especially on the CPU and the end users may see a slow response (or at the very least the servers are spending a lot of cycles doing things they weren't designed to do). To resolve these kinds of issues, a Load Balancer capable of handling SSL Offloading in specialized hardware may be used. When Load Balancers are taking the SSL connections, the burden on the Web Servers is reduced and performance will not degrade for the end users.
- Distributed Denial of Service (DDoS) attack protection: load balancers can provide features such as SYN cookies and delayed-binding (the back-end servers don't see the client until it finishes its TCP handshake) to mitigate SYN flood attacks and generally offload work from the servers to a more efficient platform.
- HTTP compression: reduces amount of data to be transferred for HTTP objects by utilizing gzip compression available in all modern web browsers
- TCP offload: different vendors use different terms for this, but the idea is that normally each HTTP request from each client is a different TCP connection. This feature utilizes HTTP/1.1 to consolidate multiple HTTP requests from multiple clients into a single TCP socket to the back-end servers.
- TCP buffering: the load balancer can buffer responses from the server and spoon-feed the data out to slow clients, allowing the server to move on to other tasks.
- HTTP caching: the load balancer can store static content so that some requests can be handled without contacting the web servers.
- Content Filtering: some load balancers can arbitrarily modify traffic on the way through.
- HTTP security: some load balancers can hide HTTP error pages, remove server identification headers from HTTP responses, and encrypt cookies so end users can't manipulate them.
- Priority queuing: also known as rate shaping, the ability to give different priority to different traffic.
- Content aware switching: most load balancers can send requests to different servers based on the URL being requested.
- Client authentication: authenticate users against a variety of authentication sources before allowing them access to a website.
- Spam filtering: at least one load balancer allows the use of an IP reputation database to refuse mail from known spammers even before sending the messages to other spam filters being load balanced.
- Programmatic traffic manipulation: at least one load balancer allows the use of a scripting language to allow custom load balancing methods, arbitrary traffic manipulations, and more.
- Firewall: Direct connections to backend servers are prevented, for security reasons
In telecommunications
Load balancing can be useful when dealing with redundant communications links. For example, a company may have multiple Internet connections network access even if one of the connections should fail. A failover arrangement would mean that one link is designated for normal use, while the second link is used only if the first one fails. With load balancing, both links can be in use all the time. A device or program decides which of the available links to send packets along, being careful not to send packets along any link if it has failed. The ability to use multiple links simultaneously increases the available bandwidth. Major telecommunications companies have multiple routes through their networks or to external networks. They use more sophisticated load balancing to shift traffic from one path to another to avoid network congestion on any particular link, and sometimes to minimize the cost of transit across external networks or improve network reliability.
- Further information: Routing
Relationship with failover
Load balancing is one way to implement failover - the continuation of service despite the failure of one or more pieces of equipment. Failover without load balancing means that there is a single "live" component which is replaced by a single "backup" component in the event of a failure. Load balancing supports multiple simultaneous "live" components. Disk mirroring is one example of the "traditional" type of failover.
References
- Tony Bourke: Server Load Balancing, O'Reilly, ISBN 0-596-00050-2
- Chandra Kopparapu: Load Balancing Servers, Firewalls & Caches, Wiley, ISBN 0-471-41550-2
- Robert J. Shimonski: Windows Server 2003 Clustering & Load Balancing, Osborne McGraw-Hill, ISBN 0-07-222622-6
- Jeremy Zawodny, Derek J. Balling: High Performance MySQL, O'Reilly, ISBN 0-596-00306-4
- Matthew Syme, Philip Goldie: Optimizing Network Performance with Content Switching: Server, Firewall and Cache Load Balancing'', Prentice Hall PTR, ISBN 0-13-101468-4
Vendors
- .vantronix | secure systems
- 2X Software, Ltd.
- A10 Networks
- Astaro
- Astrocom
- Barracuda Networks
- CAI Networks
- Celestix Networks
- Cisco
- Citrix
- Coyote Point Systems
- Crescendo Networks
- DBAM Systems
- Elfiq Networks
- Exceliance
- FatPipe Networks
- F5 Networks
- Foundry Networks
- Inlab Software
- jetNEXUS
- Juniper Networks
- KEMP Technologies
- Nortel
- PePLink Multi-WAN Routers
- Parallel Computers Technology, Inc. (PCTI)
- Proto Co Networking
- Radware
- Strangeloop Networks
- RouterStudio Load Balancing
- Xrio - Unified Bandwidth Management Range of Load Balancers
- Zeus Technology
- Sentral Systems Ltd
- stonesoft
- ASPSERVEUR - Load Balancing as ASP services
See also
External links
- XLB Open Source HTTP (Layer-7) Loadbalancer
- IPVS Open Source Layer-4 Loadbalancer
- OpenBSD relayd Open Source Layer 3/4/7 Loadbalancer
- set-rule-to-create-andor-maintain-a-network-attached-server
- Dynamic Load Balancing and Scheduling
- Load Sharing and Balancing
- Load Balancing in Signaling Transfer Points
- What Is Network Load Balancing?
- Performance Tuning Corporation
- Article "Load Balancing for Small Businesses" by Network Computing
- Article "BalanceNG: A simple approach to load balancing" by Anze Vidmar
- Article "Taking a load off: Load balancing with balance" by Costa Walcott
- Article "Simple webserver load balancing with Pound" by Steve Kemp
- Article "Whitepaper on software load balancing" by Proto Co Networking
- Article "DNS Load Balancing" by Mark Henry
- Article "Making applications scalable with Load Balancing" by Willy Tarreau
- How does CORBA support load-balancing?
- A Practical Path Towards the Ultimate Microsoft SQL Server Scalability and Availability by Justin Shih


