Round Robin Load Balancing Explained

Web pages and applications today are under constant pressure to perform. Whether it’s customers shopping online, teams collaborating on cloud platforms or users streaming media, they expect a fast and reliable experience. That’s why load balancers are essential in modern IT environments.

Load balancing is the process of distributing incoming network traffic across multiple servers so that no single one is overwhelmed by too much demand. By spreading the load, organizations can improve application responsiveness, availability and user experience. Round robin is a fundamental and widely implemented method among the various load balancing techniques available.

In this blog, we’ll look at round robin load balancing, explore how it works, its variations and when to use it. We’ll also examine related techniques like DNS round robin and advise on choosing a load balancing method to deploy.

What is Round Robin Load Balancing?

Round robin load balancing is a straightforward traffic distribution method that follows a simple rotation system to allocate incoming client requests to a pool of application servers. The name round robin comes from the circular pattern it follows when distributing requests.

When a client request arrives, the load balancer forwards that request to the first server in the backend server pool. When the next access request arrives, the load balancer sends it to the second server. Then the third request gets routed to the third server and so on. Once all servers have received a request, the cycle starts again with the first server.

Imagine dealing a deck of cards to players around a table. The dealer (load balancer) gives one card (client request) to the first player (server), then one to the second player and continues around the table until all players have a dealt card. Once the dealer reaches the last player, they start again with the first.

This is essentially how round robin load balancing operates. If there are three servers, the load balancer will send the fourth request to server 1. If there are 10 servers in the backend server pool, then the eleventh request starts over with server 1.

Organizations typically use the basic round robin method in environments where:

  • Servers have similar specifications and processing capabilities.

  • The workload consists of relatively uniform requests.

  • Simplicity of setup and maintenance is a priority.

  • Predictable distribution patterns are desired.

The simplicity of round robin makes it easy to implement and manage, which is why it remains one of the commonly used load balancing algorithms despite the availability of more sophisticated methods.

While the basic round robin method works well in simple scenarios, various enhanced versions exist to address specific needs and challenges in different environments.

Weighted Round Robin

Weighted round robin builds upon the basic round robin method by assigning different processing capabilities to servers in the backend server pool. System administrators can assign a higher weight score to servers with multiple processors and more processing cores, or those with additional memory installed. The scale used for the weighting doesn’t matter. It’s just the differences in weighting between servers that matters.

This weight is taken into account by the load balancer when deciding which server in the pool to send a request to. For example, if server 1 is twice as powerful as servers 2 and 3, it might be assigned a weight of 100, while the others get weights of 50. In this scenario, server 1 would receive twice as many client requests as the other servers during each cycle. So, server 1 would get access requests 1 and 2, then server 2 would get access request 3 and so on.

Benefits of Weighted Round Robin Load Balancing

  • Allows for efficient use of servers (or virtual machine hosts) with different hardware capabilities.

  • Maximizes the value of more powerful hardware.

  • Provides flexibility in resource allocation.

Limitations of Weighted Round Robin Load Balancing

  • Requires manual configuration and maintenance of server weights.

  • Doesn’t account for real-time server health or performance (neither does basic round robin).

Typical Use Cases for Weighted Round Robin Load Balancing

  • Environments with heterogeneous server infrastructure.

  • Scenarios such as application testing and rollout when deploying updates to selected servers (A/B Testing).

Least Connection

Unlike round robin or weighted round robin, which don’t consider the current state of servers, least connection load balancing uses a dynamic algorithm to distribute client requests to the application server with the least number of active connections. This load balancing method considers the dynamic connection load and doesn’t send requests to servers that cannot handle additional sessions.

A use case for least connection load balancing is when client sessions can maintain connections that vary in length. If clients can retain a connection for an extended period, there is a possibility that a single server will end up with all its capacity used by multiple long-lived connections. Using the least connections algorithm will prevent this from being a problem, as the load balancer will not send requests to a server that is already busy.

Benefits of Least Connection Load Balancing

  • Prevents overloading of servers with long-lived connections.

  • Adjusts automatically to changing connection requirements and patterns.

  • Improves overall server resource utilization.

Limitations of Least Connection Load Balancing

  • Slightly more complex to implement than basic round robin.

  • Requires the load balancer to track the current status of the servers in the pool.

  • May not be ideal if all connections have similar processing requirements.

Typical Use Cases for Least Connection Load Balancing

  • Applications with varying connection times.

  • Services where connections may persist for extended periods.

Weighted Least Connection

Weighted least connection combines the concepts of weighted round robin and least connection. It considers both the current number of active connections and a pre-assigned weight for each server when making load balancing decisions.

If two servers have the same active connections, the server with the higher weight receives the new connection. If servers have different numbers of connections, the algorithm factors in both connection count and server weight to determine the best destination.

Use cases for weighted least connection load balancing will be similar to basic least connection but applicable to server pools where the servers are not all the same. It will provide the same protection against persistent connections going to a single server or the most powerful server in a mixed pool.

Benefits of Weighted Least Connection Load Balancing

  • Combines the advantages of both weighted round robin and least connection.

  • Works well with heterogeneous server pools and when handling varied workloads.

  • Provides more intelligent traffic distribution than either method on its own.

Limitations of Weighted Least Connection Load Balancing

  • More complex to configure and manage.

  • Requires both weight assignment and connection tracking.

Typical Use Cases of Weighted Least Connection Load Balancing

  • Mixed environments with servers of different capacities.

  • Applications with varying connection durations and processing requirements.

  • High-traffic websites that require both load awareness and server capacity considerations.

IP Hash

The IP hash algorithm uses the client’s source IP address to determine which server should receive the request. It creates a unique hash key based on the client’s IP and uses this key to map the client to a specific server. As the key can be regenerated if the session disconnects, reconnection requests can be redirected to the same server previously used. This is called server affinity. This load-balancing method is most appropriate when a client must always return to the same server on each successive connection, like in shopping cart scenarios where items placed in a cart should still be there when a user connects later.

Benefits of IP Hash Load Balancing

  • Delivers session persistence (the same client always goes to the same server).

  • Useful for applications that require client-server affinity.

  • Distributes load fairly evenly across servers over time.

Limitations of IP Hash Load Balancing

  • Distribution can become uneven if many clients share the same IP (as with NAT).

  • Server capacity differences aren’t considered.

  • Server failures can disrupt many user sessions.

Typical Use Cases of IP Hash Load Balancing

  • E-commerce applications with shopping carts.

  • Banking applications that require session continuity.

  • Applications that don’t use cookies for session tracking.

URL Hash

The URL hash load balancing algorithm is similar to source IP hashing, except the hash created uses the URL in the client request. The hash generated is used to direct client requests asking for a particular URL to a specific backend server. A typical use case would be to direct traffic to an optimized media server that can play video or an optimized server for another specialized task.

Benefits of URL Hash Load Balancing

  • Improves caching efficiency by confirming that the same content always gets served from the same server.

  • Useful for content-specific optimizations.

  • Helps with content-based routing.

Limitations of URL Hash Load Balancing

  • Can lead to uneven distribution if certain URLs are requested more frequently.

  • Doesn’t consider server load or capacity.

Typical Use Cases of URL Hash Load Balancing

  • Content delivery networks.

  • Media-heavy websites with specialized content servers.

  • Applications with URL-specific optimization needs.

When Should You Use Round Robin Load Balancing?

Round robin load balancing shines in specific scenarios but is less useful for others. Understanding these scenarios will help you determine whether it’s the right choice for your infrastructure and applications.

Round Robin is Suitable When:

  • Your application servers are identical in terms of processing power, memory and capacity.

  • Your applications are stateless, meaning they don’t need to track user session information.

  • You have simple infrastructure needs and prioritize ease of setup and maintenance.

  • Your traffic patterns are predictable, and request processing times are relatively uniform.

  • You’re just beginning to implement load balancing and want to start with something straightforward.

Round Robin is Not Recommended When:

  • Your servers in your pool have significantly different capacities or resources.

  • You need to account for real-time server health and performance metrics.

  • Your applications require sticky sessions, such as e-commerce sites with shopping carts.

  • You have processing times that vary significantly between different types of requests.

  • You have critical applications where optimal performance is essential under varying load conditions.

  • You have servers optimized to serve specific data types like video or audio.

In these cases, organizations might be better served by one of the variations discussed above or by more advanced algorithms like adaptive load balancing or weighted response time.

DNS Round Robin: How It Works

DNS round robin is a simple method used to load-balance servers or provide fault tolerance. It is a load balancing technique that uses DNS (Domain Name System) rather than dedicated load balancing hardware or software. With DNS round robin, multiple A records are configured for a single domain name, each pointing to a different server IP address. When a client makes a DNS query for the domain, the DNS server can return all the IP addresses associated with that domain but rotates the order of these addresses for each response. This IP Address rotation effectively distributes traffic across multiple servers.

[POSSIBLE DIAGRAM: Multiple A records pointing to multiple server IPs]

Unlike advanced load balancers like Progress Kemp LoadMaster, DNS round robin operates at the DNS IP address allocation level before a client connects to backend servers or load balancers.

What Is the Purpose of DNS Round Robin?

DNS round robin serves as a simple load distribution method for traffic to websites and applications. Administrators typically use DNS round robin when:

  • Businesses need basic traffic distribution without the advanced features of a dedicated load balancer.

  • Organizations have limited budgets but need some form of load distribution.

  • Applications need to serve multiple geographic locations without deploying complex global server load balancing.

  • Application architecture is simple and doesn’t require advanced session handling.

The Benefits of DNS Round Robin

  • Cost Effective - DNS round robin requires no additional hardware or software beyond your existing DNS infrastructure, making it an extremely cost-effective solution for basic load distribution.

  • Easy to Implement - Setting up DNS round robin is straightforward and can usually be accomplished in minutes by adding multiple A records to your DNS configuration.

  • No Deployments of Hardware or Software Required - Since DNS round robin leverages existing DNS infrastructure, there’s no need to deploy and maintain additional hardware or software components.

Drawbacks of DNS Round Robin

While DNS round robin provides basic load distribution, it lacks the advanced features found in dedicated load balancers like LoadMaster:

  • No Server Health Checks - DNS round robin cannot detect if a server is down or experiencing issues. It will continue to direct traffic to failed servers until DNS records are manually updated.

  • No Session Persistence - There’s no guarantee that a user will connect to the same server across multiple sessions, which can be problematic for applications that require session continuity.

Additionally, DNS round robin suffers from client-side DNS caching issues and lacks traffic management capabilities beyond the basic rotation of IP addresses.

Final Thoughts and Best Practices

Round robin load balancing, in its various forms, remains one of the most widely implemented methods for distributing network traffic. Its simplicity makes it accessible for organizations of all sizes, while its variations offer solutions for more complex environments.

The basic round robin method provides an excellent starting point for many organizations, especially those just beginning to implement load balancing. As your infrastructure grows and requirements get more complex, you can transition to weighted algorithms or more sophisticated methods that account for real-time server health and performance.

Remember that even with simple round robin load balancing, you can enhance your implementation by combining it with server health monitoring. This allows you to manually remove unhealthy servers from the server pool so that traffic only gets directed to healthy and functional resources.

LoadMaster free load balancer is an advanced 20Mbps load balancer that is a free forever solution that includes features from the commercial versions such as Layer 4 & Layer 7 load balancing, advanced health checking, session persistence, intelligent traffic management and more that delivers high availability and improved performance for non-commercial deployments. Download a free forever copy of Free LoadMaster today.

Round Robin Load Balancing FAQs

What is round robin load balancing?

Round robin load balancing is a method that distributes incoming network traffic across multiple servers in a sequential, rotating order. The first client access request goes to the first server, the second one to the second server and so on, cycling back to the first server once all servers have received a request.

Is DNS round robin effective?

DNS round robin can be effective for basic load distribution across multiple servers, especially when budget constraints exist. However, it lacks important features like the health checks and session persistence provided by dedicated load balancers, making it less suitable for mission-critical applications.

What’s the difference between round robin and weighted round robin?

In basic round robin, all servers receive an equal share of traffic as requests get distributed sequentially. In weighted round robin, each server is assigned a weight based on its capacity, and servers with higher weights receive proportionally more sessions than those with lower weights.

How do I set up DNS round robin?

To set up DNS round robin, create multiple A records for the same domain name, each pointing to a different server IP address. For example, for the domain, mydomain.com, you might create three A records, each pointing to a different IP address. Most DNS servers will automatically rotate the order of these records in responses, distributing client connections across the servers.

Download Your Free LoadMaster Load Balancer

Download