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.
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-3 Load Balancing
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-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.
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.