Nerdsense

Loadbalancing: Boots & cats &

Greg Heffner July 14, 2024
Load Balancing

Loadbalancers are probably what you expect them to be if you had no idea what they did. They take a load and balance it. What does that mean for us? Well a few things. It enables us to route traffic more efficiently, allows us to enable high availability, and another example would be that loadbalancing enables health monitoring. When you get on the internet and go to a major webpage most likely you have used a loadbalancer in your route to it. I would imagine you could have hit multiple loadbalancers to get there. Really depends on the service youre connecting to and how it is built. In previous blogs we have talked about DNS and how you take a name and convert it to an IP address to get to a webpage. Well loadbalancing allows us to put multiple devices behind that one IP address or a range of addresses.

Think of it like this. You have an in person event lets say greg.heffner.live Presents Odourles Aunt, a concert with a live band in town! You want to make sure that it is easy for the guests to get in from the street to the show floor. You setup multiple ticket booths to let people in the quickest rather than just the one booth. The way the guest traffic is routed to devices (ticket booths) is explained in two major categories, Dynamic or Static loadbalancing. The rules that are followed to route traffic are called algorithms. I am going to explain the most used algorithm in each category.

Dynamic loadbalancing algorithms consist of Least Connection, Weighted Least Connection, Weighted Responce Time, and Resource-Based rules. Key word here is dynamic. Notice all of these rules are based off of things that change often on a device. Number of connections, response time of the device, or the amount of available resources on the device.

Static Loadbalancing consists of algorithms like Round Robin, and IP Hash. Static is the key word here. These rules are written to be followed irreguardless of any of the dynamic resources we talked about earlier in dynamic loadbalancing. When youre next in line its your turn. An IP hash is another way of saying a specific address or key that a backend server can use to route to the correct home device key pair. Think of Gates at a concert. If you are in Section B they may want all guests of that section to go to a specific ticket booth.

Round Robbin Static:

Round Robin Load Balancing
From F5 Networks page an example of Round Robin LoadBalancing. Notice one line in, and splitting the traffic between multiple queues.

Round Robin loadbalancing will send traffic to one device after the other. If you have 3 ticket booths behind a gate as shown in this example when the guests start arriving the guests will be sent to one booth after the other, in a round robin fashion. The loadbalancing algorithm does not care how many people are already in the line at the booth, nor does it care about amount of work the ticket booth has already done or is about to do. The loadbalancer will send traffic from one host to another one after the other as long as someone is there.

Least connection dynamic:

Round Robin Load Balancing
Also from F5 Networks page a great example of Least Connection LoadBalancing. One line in but sending traffic to the shortest queue.

Least connection loadbalancing is a little more robust because there is a extra step taken that will see how many connections are active on a device before sending traffic to it. This type of loadbalancing is the type the guests would prefer as they are entering the concert. Instead of going to the next booth in line like round robin the guests will go to the booths with the least number of total people or fastest most efficient ticket clicker person. This may or may not be the same booth as the person in front of you. Depends on the dynamics of the situation.

As you can probably tell both solutions are successful. The loadbalancing type is usually easy to figure out when you focus on the traffic and your traffic obligations. A major video streaming service's loadbalancers may want to use IP Hash loadbalancing. This could send certain users, depending on geolocation of the IP address, to the closest hosting server to them in the world. Or a major social media platform may want to use Round Robin loadbalancing to make sure all users get to their servers, irreguarless of server resource usage. We use loadbalancers everyday wether you know it or not. Lets just hope they dont have major outages that could affect all the internet.

P.S.

Dont blame me the next time you go to a concert and think of loadbalancing, just hope their lines are dynamic and not static.

About Me

I served in the U.S. Army, specializing in Network Switching Systems and was attached to a Patriot Missile System Battalion. After my deployment and Honorable discharge, I went to college in Jacksonville, FL for Computer Science. I have two beautiful and very intelligent daughters. I have more than 20 years professional IT experience. This page is made to learn and have fun. If its messed up, let me know. Im still learning :)

Weather Loop