Sign up for a live Kubernetes or DevSecOps demo

Click here

DevOps Glossary

Load Balancer

What is a Load Balancer?

Capacity management is one of the most important problems that web developers, application owners, SaaS companies and Enterprise IT organizations must address for the applications and services they provide. An organization that hosts an application might allocate a single server to facilitate application requests, but as the demand for requests increases, that server may quickly reach its capacity for fulfilling requests in a reasonable time frame without errors or timeouts. To meet the growing demand for application services, IT organizations increase their capacity by spreading the workload across multiple servers.

When an organization allocates more than one server to handle requests for a website or business application, a load balancer is used to distribute requests between them. The purpose of a load balancer is to spread requests between a group of servers, preventing any individual server from becoming overloaded with requests. An overworked server can lead to slow-downs, timeouts, and mishandled or lost requests that negatively impact the customer experience.

Load balancing can be accomplished in several different ways. There are both hardware and software load balancers and each type may use several different algorithms for splitting up work between servers. Load balancers may also include additional value-added features that help IT organizations maintain application security while increasing their capacity to fulfill application requests.

Hardware vs Software Load Balancers - What's the Difference?

The first load balancers for enterprise IT were marketed in the 1990s as a hardware appliance that could efficiently route packets throughout a network. Today, vendors of load balancer software solutions market virtual appliances that serve the same function - they have extracted the software from the traditional hardware load balancer and packaged it into a virtual machine (VM) that runs as a software tool. Software load balancers may also be referred to as Application Delivery Controllers (ADCs).

A hardware load balancer can route packets with the same efficiency as a software-based solution but comes with many of the inconvenience that is associated with hardware IT infrastructure. Hardware load balancers take longer to install, requiring specific expertise to configure and implement in the most efficient way. If demand for the application scales beyond what the hardware load balancer can handle, scaling the solution up to increase service levels will require additional hardware components, deployment time and up-front costs.

A software load balancer, in contrast, can be readily scaled based on the demands of the application. The up-front cost is reduced, as there is no required investment in hardware components, and the solution can be rapidly deployed without a lengthy implementation process.

For organizations that deliver critical applications and services using cloud-based IT infrastructure, a software load balancer solution provides increased flexibility, scalability and ease of deployment that is more in-line with the needs and expectations of today's leading technology companies. Hardware solutions are more costly to purchase and implement but may provide additional features that justify the cost.

Five Standard Load Balancer Algorithms

There are many types of systems and applications that use a load balancer to efficiently route packets and requests to multiple servers. Websites that receive high volumes of traffic may rely on a network of servers and a load balancer to meet demand. NNTP servers, FTP sites, DNS servers, and heavily trafficked databases also rely on load balancer technology to provide the best experience for users.

To achieve the service and convenience levels that users expect, IT organizations must carefully select which type of algorithm to use for their chosen load balancer solution. Each algorithm uses a different methodology for determining where each packet or service request should be routed.

Round Robin Algorithm - Round robin may be the simplest form of load balancer algorithm. In this model, a server farm is configured to handle application requests in a rotating sequence. This method ignores the individual capacity of each server when assigning new requests.

Weighted Round Robin Algorithm - A weighted round-robin algorithm represents a slight improvement over the traditional round-robin model. This method distributes requests in a rotating sequence, but each server is weighted differently in terms of how many requests it can process. A server with a greater capacity would receive a greater number of requests than a server with lesser capacity.

Least Connections Algorithm - A least connections algorithm functions by routing application requests to the server that currently has the fewest active connections. This method assumes that all connections require an equal amount of computing resources when this is not necessarily the case.

Least Response Time Algorithm - The least response time algorithm distributes application requests to the server with the lowest response time. Response time is measured using a metric called Time To First Byte (TTFB). The load balancer pings servers in the server farm and measures the time interval between when the request is sent and when the first response packet is received. The server that pings fastest will receive the next request.

IP Hash Algorithm - An IP hash algorithm deals with one of the most important problems that IT organizations encounter when applying a load balancer to an application or service: persistence. If a user makes multiple requests in a session, there may be a need for some information to be stored or maintained across multiple requests. If the load balancer routes each request in a session to a different server, the information needed to fulfill a request might be stored on a server that was used for an earlier request.

An IP Hash algorithm addresses this issue by combining the source and destination IP addresses into a hash key that gets assigned to the server handling the initial request. If the user in the same session makes a new request, the hash key ensures that they connect to the same server as before.

Monitor Your Application Load Balancer with Sumo Logic

IT organizations that deploy load balancer software tools in the cloud can use Sumo Logic's log aggregation and analytics capabilities to monitor the operational performance of services running behind application load balancer software.

The Sumo Logic app can be used to monitor key metrics like request count, ELB error count and latency, helping you detect performance and availability issues, streamline troubleshooting and optimize the customer experience.