Skip to content

Everything You Need To Know About Load Balancing a Server

March 25, 2019

If you’ve ever had a website or application crash on you when you’re in the middle of, say, online shopping, then you’ve seen how improper workload management can negatively impact users.

Within company IT infrastructure, if too many users try to access the same data or software at the same time, this can also cause a crash if the traffic isn’t properly balanced. How do companies achieve that balance? Enter load balancing.

What is load balancing?

Load balancing is how request processing stays fluid and functional.

Load balancing devices called load balancers use either native or installed load balancing software to distribute traffic or workloads across processing resources with the goal of creating a more optimized end-user experience. Think of a load balancer as the access gate that determines how data gets to a company’s servers.

Types of load balancing

There’s no one right way to balance a workload, but each type does present certain advantages and disadvantages. Examples of load balancing methods include random assignment, round robin, source IP has and least connection.

Random assignment

By far the least organized of all the load balancing methods, random assignment does exactly what it says: It randomly assigns each workload to a server in a group of servers (server pool). 

what is load balancing random assignment


The theory behind random assignment sounds more complicated than it is. In probability theory, the Law of Large Numbers says that as a sample size grows, the median (middle) result in a sample set will eventually match the mean (average) result. Applied here, it means that the more times a workload is randomly assigned to a server within the pool, eventually every server in the pool will be handling approximately equal workloads even though the workloads may initially be unequal.

Of course, there are a few obvious, but conquerable, issues here:

  1. It’s entirely possible that some servers in random assignment will have significantly more load than others. After all, random assignment doesn’t care if server A has 4,000 connections and server F has 400.
  2. This method doesn’t work well for low-traffic situations, or situations where the number of servers being used doesn’t scale. If a company has 25 site visitors and 15 servers, it’s entirely possible that, instead of distributing those visitors equally over three to five servers, there will be six users on one, five on another, and one on each of the rest.

Round robin

 The first of the more organized load balancing methods, round robin functions a lot like the game tournament style of the same name. Each server in a server pool is assigned a spot in the overall order of use, and each time new traffic comes in, it goes to the next server on the list.

round robin load balancing


Round robin distribution ensures each server can address incoming traffic. Issues arise, though, when length or processing demand of connections are taken into account. When long connections, or connections that have significant traffic flowing through them, start stacking up on a server, some servers can end up with much higher traffic than others, despite servers being given equal connections.

Source IP hash

 IP hashing works to distribute workload based on the incoming IP address of a server request, making it much more sophisticated than the previously mentioned methods. An incoming workload is algorithmically assigned a hash key based on its source IP address and destination, which is then used to assign a server to handle the incoming workload.

source IP hash load balancing


IP hashing can be an incredibly efficient way of handling incoming traffic, but there is a catch: What if there’s a ton of traffic coming from the same IP address? This can result in an overload on a single server. Overcoming this issue would involve setting capacity rules for either the number of connections on a single server from a single source, or on how many connections from a single source are allowed.

Least connection

 In a similar class to source IP hashing, the least connection method focuses its load balancing efforts on distributing traffic to the servers that currently have the fewest active connections. The idea is that any one server in the server pool should never end up with a significantly higher number of active connections than any other.

least connection load balancing


 While this method does have issues with longer traffic connection times stacking up on a single server, it also, by design, deals with this issue better than other methods. Even with longer or more demanding sessions stacked up on a server, the server will never hit a significantly higher user count than any other server, which helps contain the demand issue.

Load balancing and DDoS

Load balancing serve an additional business use as an extra security measure. By balancing out heavy incoming workloads, they improve resilience to direct denial of service (DDoS) attacks. By including cloud offloading with load balancing solutions, DDoS attacks become further ineffective, as the attack is shrugged away from a company’s servers into a public cloud.

Now, see how load balancing can impact one of the hottest topics in IT. Learn about cloud computing and why it's a big deal.

Never miss a post.

Subscribe to keep your fingers on the tech pulse.

By submitting this form, you are agreeing to receive marketing communications from G2.