In the context of parallel computing, Load Balancing is the distribution of a set of tasks over different computing units (or related resources), to make the overall process easier to execute and much more efficient. Ensuring no single server bears too much of demand and evenly spreading the load, it improves the responsiveness and availability of applications or websites for the user.
Modern applications and websites cannot function without balancing the load on them. This is for the reason that such applications and sites serve millions of simultaneous requests from the end-users and have returned the correct text and images or the related data asked for, responsively, and reliably. Adding more servers was considered to be good practice for meeting such high volumes of traffic, so far.
But, the concept of balancing the load with a dedicated Load Balancer unit is a much more economical and effective way of ensuring the peak performance of the website or application and offering the end-user a great experience.
The load balancing concept was initiated in 1990 with special hardware that was deployed to distribute traffic across a network. With the development of Application Delivery Controllers (ADCs), load balancing became a better-secured convenience, offering uninterrupted access to applications even at peak times.
ADCs are categorized as Hardware Appliance, Virtual Appliance, and Software Native Load Balancers. In this era of cloud computing, the software-based ADCs are used to perform tasks as the hardware counterpart performs but with better scalability, functionality, and flexibility.
In general, a Load Balancer acts as a ‘traffic controller’ for your server and directs the requests to an available one, capable of fulfilling the request efficiently. This ensures that requests are responded to fast and no server is over-stressed to degrade the performance.
In an organization’s attempt to meet the application demands, Load Balancer assists in deciding which server can efficiently handle the requests. This creates a better user experience.
By helping servers move data efficiently, information flow between the server and endpoint device is also managed by the load balancer. It also assesses the request-handling health of the server, and if necessary, Load Balancer removes the unhealthy server until it is restored.
As the servers can also be physical or virtual, a load balancer can also be a hardware appliance or a software-based virtual one. When a server goes down, the requests are directed to the remaining servers and when a new server gets added, the requests automatically start getting transferred to it.
Several load balancing techniques are there for addressing the specific network issues:
a.) Network Load Balancer / Layer 4 (L4) Load Balancer:
Based on the network variables like IP address and destination ports, Network Load balancing is the distribution of traffic at the transport level through the routing decisions. Such load balancing is TCP i.e. level 4, and does not consider any parameter at the application level like the type of content, cookie data, headers, locations, application behavior etc. Performing network addressing translations without inspecting the content of discrete packets, Network Load Balancing cares only about the network layer information and directs the traffic on this basis only.
b.) Application Load Balancer / Layer 7 (L7) Load Balancer:
Ranking highest in the OSI model, Layer 7 load balancer distributes the requests based on multiple parameters at the application level. A much wider range of data is evaluated by the L7 load balancer including the HTTP headers and SSL sessions and distributes the server load based on the decision arising from a combination of several variables. This way application load balancers control the server traffic based on the individual usage and behavior.
c.) Global Server Load Balancer/Multi-site Load Balancer:
With the increasing number of applications being hosted in cloud data centers, located at varied geographies, the GSLB extends the capabilities of general L4 and L7 across various data centers facilitating the efficient global load distribution, without degrading the experience for end users. In addition to the efficient traffic balancing, multi-site load balancers also help in quick recovery and seamless business operations, in case of server disaster or disaster at any data center, as other data centers at any part of the world can be used for business continuity.
Load Balancers are also classified as:
a.) Hardware Load Balancers:
As the name suggests, this is a physical, on-premise, hardware equipment to distribute the traffic on various servers. Though they are capable of handling a huge volume of traffic but are limited in terms of flexibility, and are also fairly high in prices.
b.) Software Load Balancers:
They are the computer applications that need to be installed in the system and function similarly to the hardware load balancers. They are of two kinds- Commercial and Open Source and are a cost-effective alternative to the hardware counterparts.
c.) Virtual Load Balancers:
This load balancer is different from both the software and hardware load balancers as it is the combination of the program of a hardware load balancer working on a virtual machine.
Through virtualization, this kind of load balancer imitates the software driven infrastructure. The program application of hardware equipment is executed on a virtual machine to get the traffic redirected accordingly. But such load balancers have similar challenges as of the physical on-premise balancers viz. lack of central management, lesser scalability and much limited automation.
All kinds of Load Balancers receive the balancing requests, which are processed in accordance with a pre-configured algorithm.
The most common load balancing methodologies include:
a) Round Robin Algorithm:
It relies on a rotation system to sort the traffic when working with servers of equal value. The request is transferred to the first available server and then that server is placed at the bottom of the line.
b) Weighted Round Robin Algorithm:
This algorithm is deployed to balance loads of different servers with different characteristics.
c) Least Connections Algorithm:
In this algorithm, traffic is directed to the server having the least traffic. This helps maintain the optimized performance, especially at peak hours by maintaining a uniform load at all the servers.
d) Least Response Time Algorithm:
This algorithm, like the least connection one, directs traffic to the server with a lower number of active connections and also considers the server having the least response time as its top priority.
e) IP Hash Algorithm:
A fairly simple balancing technique assigns the client’s IP address to a fixed server for optimal performance.
a) Least Bandwidth Algorithm: In this method, the traffic is measured in Mbps, and the client request is sent to the server with the least Mbps of traffic.
b) Resource-Based (Adaptive) Algorithm: In this method, a computer program is installed in a server that reports the current load to the balancer. That agent program then assesses the servers and resource availability to direct the traffic at the best-suited server at the moment.
c) Resource-Based (SDN Adaptive) Algorithm: In this method, comprehensive knowledge from all layers of the application and inputs from an SDN Controller is analyzed to make better decisions regarding traffic distribution.
d) Source IP Hash: In this method, the client’s and server’s IP addresses are mixed to generate a unique hash key, which then allocates the traffic to a particular server.
e) URL Hash: This algorithm distributes writes uniformly across multiple sites direct all reads to the website owning a particular object.
Redirecting the traffic at the most functional server of the moment delivers the following advantage:
1. Enhanced Performance:
Load Balancers reduce the additional load on a particular server and ensures seamless operations and response, giving the clients a better experience.
The failed and under-performing components can be substituted immediately and giving information about which equipment needs service, with nil or negligible downtime.
Without any change in any form, Load Balancer gives an additional layer of security to your website and applications.
Without disrupting the services, Load Balancers make it easy to change the server infrastructure anytime.
2. Predictive Analysis:
Software load balancers can predict traffic bottlenecks before they happen in reality.
3. Big Data:
Actionable insights out of the big data generated by global users can be analyzed to drive better and informed business decisions.