Load balancing
In computing, load balancing is a technique used to spread work load among many processes, computers, networks, disks or other resources, so that no single resource is overloaded.
Load balancing can also be considered as distributing items into buckets:
- data to memory locations
- files to disks
- tasks to processors
- packets to network interfaces
- requests to servers
Its goal is even distribution.
Contents
Network Load Balancing
Layer-2 Load Balancing
Layer-2 load balancing, also known as link aggregation or trunking, is to bond two or more links into a single, higher-bandwidth logical link. Aggregated links also provide redundancy and fault tolerance if each of the aggregated links follows a different physical path. Link aggregation may be used to improve access to public networks by aggregating modem links or digital lines. Link aggregation may also be used in the enterprise network to build multigigabit backbone links between Gigabit Ethernet switches.
The Linux kernel has the Linux bonding driver, which can aggregate multiple links for higher throughput or fault tolerance.
Layer-4 Load Balancing
Layer-4 load balancing is to distribute requests to the servers at transport layer, such as TCP, UDP and SCTP transport protocol. The load balancer distributes network connections from clients who know a single IP address for a service, to a set of servers that actually perform the work. Since connection must be established between client and server in connection-oriented transport before sending the request content, the load balancer usually selects a server without looking at the content of the request.
IPVS is an implementation of layer-4 load balancing for the Linux kernel, and has been ported to FreeBSD recently.
Layer-4 load balancing can be used to balance traffic at mutliple Internet access links, in order to increase Internet access speed. See more information at DSL load balancing.
Layer-7 Load Balancing
Layer-7 load balancing is to parse requests in application layer and distribute requests to servers based on different types of request contents, so that it can provide quality of service requirements for different types of contents and improve overall cluster performance. The overhead of parsing requests in application layer is high, thus its scalability is limited, compared to layer-4 load balancing.
KTCPVS is an implementation of layer-7 load balancing for the Linux kernel.
DNS Load Balancing
DNS load balancing is to distribute requests to different servers though resolving the domain name to different IP addresses of servers. When a DNS request comes to the DNS server to resolve the domain name, it gives out one of the server IP addresses based on scheduling strategies, such as simple round-robin scheduling or geographical scheduling. This redirects the request to one of the servers in a server group. Once the domain is resolved to one of the servers in specified time-to-live, subsequent requests from the clients using the same local caching DNS server are sent to the same server.
More information is on the DNS Load Balancing page.
Computing Load Balancing
Computing load balancing is to split a computational task across many different nodes in the cluster, so that the whole cluster system can provide increased performance. This kind of cluster systems is also known as High-performance cluster, which is most commonly used in scientific computing.
Database Load Balancing
Database load balancing is to balance database access requests among cluster of database servers, in order to achieve database scalability and high availability.