What Is Load Balancing? How Load Balancers Work

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Modern traffic-intense websites should be able to handle hundreds of thousands, or even millions of simultaneous requests from users and clients and display correct images, texts, video or application data, staying quick and responsive. In order to deal with a high volume of traffic, you need to apply the best practices available and attract more servers.

This is where a load balanced will come in handy. What is a load balancer and how it works? This is a hardware- or software-based solution that distributes the traffic over your servers and directs clients to the servers capable of fulfilling their requirements so that to improve speed and capacity utilization, and make sure that none of servers overworks. That boosts performance significantly. Even if a single server goes down, the load balancer will redirect traffic to functioning online servers. When you add a new server to the group of your servers, a load balancer will start to redirect requests to it.

Therefore, a load balancer has several functions:

  • distributes visitors’ requests and network load across several servers in the most efficient manner;
  • allows for flexibility to add ad remove servers according to your demands;
  • guarantees a high availability and reliability by sending requests to working servers only.

Load Balancing Algorithms

Every algorithm of load balancing has its own advantages, and the choice of load balancing method should depend on your needs:

  1. Least Connections. A request is sent to the server with the smallest number of current connections to the visitors. To calculate which server has the least connections, a load balancer evaluates relative computing capacity of each server.
  2. Round Robin. Requests are distributes over servers sequentially.
  3. IP Hash. A client is connected to the closest server according to his IP address.

Session Persistence

It’s not a secret that the information about user’s session is usually stored in the browser (for example, shopping carts). Changing the server that receives requests from a client in the middle of his or her session can lead to problems with performance and failure of transaction. This is why it’s important to make sure that the requests from a client are directed to one and the same server during the entire session. This is called “session persistence”.

Worthy load balancers guarantee session persistence. Another good example of session persistence is when an upstream server keeps the data requested by a user in its cache to improve performance. Changing servers can make this information disappear for some time, which can hurt performance and speed.

Dynamic Configuration of Server Groups

Some ever-changing application need servers to be added or deleted on a regular basis, for example, the environment of Amazon Elastic Compute Cloud (they make users pay only for computing capacity that’s actually used, and at the same time allow scaling up and down according to traffic spikes). Load balancers are very helpful in such environments, because you can dynamically remove or add servers from your group without affecting current connections.

Hardware vs. Software Load Balancing

There are two basic types of load balancers: software-based and hardware-based. Providers of hardware-based options use proprietary software on their own machines, and often apply specialized processors. In order to handle growing traffic on your website, you’ll need to purchase bigger machines from your vendor. Software solutions typically work on commodity software, which makes them very flexible. You can try software on the hardware that you choose, or in cloud environments.

Vadim Kolchev

52 publications

Vadim has graduated from Moscow Institute of Entrepreneurship and Law as finance and credit specialist. Prior to starting to work in hosting business directly, he occupied various roles in several companies, including but not limited to banking sphere and sports. As of 2015 he works for INXY Holding, with SpaceCDN being a vital part of the hosting branch of its business. Being tech enthusiast, he has started writing articles about dedicated servers, CDN, storage solutions and other hosting services long ago, and since then accumulated a lot of experience and knowledge in the field. Building hosting sales and support departments from scratch has added even more experience and knowledge and allowed to see the business from the inside and build required expertise. Now Vadim is CPO and COO of a successful hosting business. Having several important interviews and publications at platforms such as Hosting Journalist and Forbes, he continues to share knowledge about this branch of technology that has become not only his job but also a passion.

Learn more about us
in social networks