![](https://www.parallels.com/blogs/ras/app/uploads/2022/10/p2.png)
Load Balancing vs Failover: An Overview
Load balancing and failover are two methods of achieving high availability. Load balancing does it by distributing workloads to prevent a single system from getting overloaded, while failover does it by redirecting workload to a backup system when the main system fails.
In this load balancing vs failover article, we’ll be looking into some of the key concepts in implementing load balancing and failover, how to choose one over the other, and some things to consider when applying any form of high availability.
Implementing Load Balancing
One of the reasons why a system becomes unavailable is because that system has reached its maximum capacity. In other words, it has been overloaded. For example, a single server getting an excessive number of requests will reach its maximum CPU and RAM capacity eventually. When this happens, that server can no longer accept any more requests from additional clients.
Definition of Load Balancing
To prevent system overload, you can implement load balancing. Load balancing is a way of achieving high levels of availability by distributing workloads between two or more systems instead of just directing it to a single system. By distributing workloads across multiple systems, you can minimize the risk of having a single system suffer from overload.
Ways of Implementing Load Balancing
Now, there are a couple of ways to implement load balancing. One way is by breaking down a system into components and then having each component perform specific functions. For example, if your web server and database server are running on a single host, you can split them up and place each one on a separate host.
Another way is by creating multiple copies of the same system and then distributing workloads across those similar systems. For example, you can have four server instances providing exactly the same web service. You can then place each of these servers behind a load balancer, distributing workloads across those web servers.
Algorithms for Load Balancing
The load balancer follows certain rules, known as load balancing algorithms, to distribute workloads. One commonly used algorithm is round robin. Round robin simply distributes workloads to each system behind the load balancer in a cyclical fashion. Although effective to a certain extent, round robin has its limitations. What if, for whatever reason, one of the systems has somehow reached maximum capacity faster than the other systems?
To avoid these situations, engineers have developed more sophisticated load-balancing algorithms. One example is the resource-based load balancing algorithm used in Parallels® RAS. This algorithm keeps track of certain metrics such as the number of existing user sessions as well as memory and CPU utilization. It then takes these metrics into account when distributing workloads.
Types of Load Balancers
It’s worth noting that load balancing normally requires the presence of a load balancer, the entity that distributes workloads. Load balancers come in different types. There are hardware-based load balancers that are deployed physically on a physical network. There are also software-based load balancers that can be installed on hosts or, in the case of virtual appliance load balancers, deployed in a virtual environment.
Implementing Failover
While load balancing strives to prevent system failure due to overload, failover is more focused on addressing the problem where a system does fail—regardless of whether the system failure is caused by overload or not. So, for example, say you have a server that’s taken out of commission due to a power outage in the facility where it’s being housed.
If that server was already set up for failover with a backup server in another facility, you could resume operations while that power outage is ongoing. The goal of failover is to keep services available even if the main system providing that service goes down by redirecting workloads to a backup system, a.k.a. a failover system.
Failover Implementation
As you might have noticed, failover requires the presence of a backup system that can perform all the functions of the main system. While the main system is active, that backup system will simply be in standby mode. It won’t be doing anything. In other words, it’s going to be in what is known as a passive state.
Active-Active and Active-Passive Configurations
If you recall, in load balancing, all systems are in active mode. In a failover setup, one system is active while another, the backup system (or perhaps several other backup systems), is passive. That’s why load balancing setups are usually called active-active high availability configurations, while failover setups are usually called active-passive high availability configurations.
Failover Requirements
The backup or failover system in a failover setup is expected to take over all the main system functions completely when that main system goes down. For this reason, the failover system needs to be a replica of that main system. It will need to replicate all configurations and data of the main system. This is known as redundancy.
For failover to be effective, the failover system shouldn’t be placed in the same location as the main system. For example, your main and failover servers shouldn’t be placed on the same rack. If possible, they shouldn’t even be placed in the same facility. That way, if the entire facility is incapacitated, the failover server won’t be affected.
Single Point of Failure Problems
Failover addresses the single point of failure problem. You can even apply it to a load balancer. While a load balancer helps minimize the risk of failure of each individual system behind it, that load balancer is a single point of failure. It doesn’t matter if all the other systems behind it are in good condition. If that load balancer fails, your services will become unavailable. You can address this problem by setting up a failover system for your load balancer that can take over should the main load balancer fail.
Choosing between Load Balancing and Failover
From a pure availability standpoint, load balancing is, in a way, better than failover. Failover comes into play only when the main system has already failed, whereas load balancing strives to prevent failure from occurring in the first place.
Some load balancers are even smart enough to detect if one of its nodes (one of the components it’s distributing load to) is completely out of commission. It can then either (1) alert you so you can remove that node from the load balancing process temporarily or (2) remove that node itself. While that problematic node is out, the load balancer will distribute load only across the remaining active nodes.
Evaluating the Costs of High Availability
Availability is measured in percentages. In a perfect world, availability would be 100%. This amounts to zero downtime. In practice, uptime, or availability, is almost always less than 100%. You can only strive to make the availability of your systems as close to 100% as possible. In the IT world, availability or uptime is normally expressed in numbers of nines.
For example:
- 99.9% uptime or 3 nines. This is equivalent to about 8 hours and 46 minutes of downtime annually.
- 99.99% uptime or 4 nines. This is equivalent to about 52 minutes and 36 seconds of downtime annually.
- 99.999% uptime or 5 nines. This is equivalent to only about 5 minutes and 15 seconds of downtime annually.
- 99.9999% uptime or 6 nines. This is equivalent to only about 31 seconds of downtime annually.
While methods such as load balancing and failover are essential for reaching higher nines of uptime, it’s worth noting that it can be quite costly to implement them. The higher the target availability of a system, the more redundancy you’ll need. So, for example, instead of having just one backup system (n+1), you’ll need more—maybe two (n+2) more or perhaps even double (2n) your number of systems. The more redundant systems you need, the more expensive it’s going to be.
Failover vs Load Balancing: Parallels RAS Offers Both
Parallels RAS is an all-in-one virtual desktop infrastructure (VDI) solution that supports load balancing and failover properties. As a VDI solution, Parallels RAS enables you to deploy your applications and desktops in central locations such as a datacenter or a public cloud like Amazon Web Services (AWS), Azure, and Google Cloud Platform (GCP). It then enables you to make those virtualized applications and desktops accessible to users through the internet.
Parallels RAS comes with High Availability Load Balancing (HALB) capabilities right out of the box. HALB removes traffic restrictions of Parallels RAS gateways, the services that act as proxies between Parallels Clients running on user endpoint devices (PCs, laptops, phones, tablets, thin clients, etc.) and your Parallels RAS servers. The more HALB appliances you have, the lower the chances your users will suffer downtime.
In addition, Parallels RAS also comes with a Reporting Engine that delivers visual and intuitive reports regarding server usage, device usage, applications access, and several other relevant pieces of information. From these reports, you can gain insights into the health of your Parallels RAS environment, which can then inform your decision-making about improving availability.
Lastly, Parallels RAS supports Microsoft Hyper-V Failover Cluster, which in turn supports Live Migration. Live Migration is a Hyper-V feature that enables you to move running VMs from one physical host to another without the users experiencing any downtime. This capability can further enhance your high availability initiatives.
Would you like to experience the load balancing and failover capabilities of Parallels RAS firsthand?