Difference between Ratio and Ratio Least Connection Load Balancing Method

Problem this snippet solves:

 

First of all, this is more like an article. I cannot publish an article so I share what I found here.

When we are choosing Load Balancing Method, we can see Ratio Least Connection mode in the list. But there are rare articles about how this load balancing method performs and what the difference between Ratio and Ratio Least Connection load balancing method is. So I run a test to distinguish them.

I set up two http service servers with the same capabilities and create a pool with these two servers as pool members using http monitor (Photo 1). Then create a virtual server and make sure the virtual server address can be accessed (Photo 2). This is a basic LTM configuration.

In order to simulate the massive connections, I use tools to create 30000 total connections and 300 concurrent connections at the same time which means the client provides 300 connections at the same time to the virtual server to test the load balancing method.

(Photo 1: Create a pool)

(Photo 2: Create a virtual Server)

 

Ratio mode

Change the load balancing method to Ratio (member) and select Update. Set ratio value as 1:5 for two pool members. In this test I set Ratio value as 10 for pool member 192.168.30.100 and set ratio value as 50 for pool member 192.168.30.150 (Photo 3). Then run the connection test.

(Photo 3: Change to Ratio load balancing method)

 

I screenshot several statistics during the connection test (Photo 4)(Photo 5)(Photo 6). From Photo 4 we can see the Current Connections of these two pool members are 300 (connections) but the Current Connection ratio of these two pool members is not 1:5. Pool member 192.168.30.100 has 31 current connections and pool member 192.168.30.150 has 269 current connections. The ratio between two pool members has reached to almost 1:9 at this moment in Current Connection, not 1:5. And the Current Connection ratio is changing all the time during the test. The ratio is 1:7.5 on Photo 5 and the ratio is 1:7 on Photo 6.

But the Total Connection ratio of these two pool members is 1:5 (Photo 4). Pool member 192.168.30.100 has almost 1000 total connections and pool member 192.168.30.150 has almost 5000 total connections at this moment. The ratio is actually 1:5. And the Total Connection ratio keeps 1:5 all the time during the test (Photo 5) (Photo 6).

 

(Photo 4)

 

(Photo 5)

 

(Photo 6)

 

After the connection test finishes running (Photo 7), we can see the final Total Connections are 30000 as set. Pool member 192.168.30.100 has 5000 total connections and pool member 192.168.30.150 has 25000 total connections. The ratio is actually 1:5 as I set at pool settings.

(Photo 7)

 

Ratio Least Connection mode

Change the load balancing method to Ratio Least Connection(member) and select Update. Keep the ratio as 1:5 (Photo 😎. Reset pool statistics and then run the connection test again.

(Photo 8: Change to Ratio Least Connection load balancing method)

 

I screenshot several statistics during the connection test (Photo 9)(Photo 10)(Photo 11). From Photo 9 we can see the Current Connection of these two pool members are 300 (connections) and pool member 192.168.30.100 has 51 current connections and pool member 192.168.30.150 has 250 current connections. The ratio between two pool members is actualy 1:5. And the ratio keeps 1:5 all the time during the test running(Photo 10) (Photo 11).

But the Total Connection ratio of these two pool members is not 1:5 (Photo 9). On Photo 9 pool member 192.168.30.100 has about 1900 total connections and pool member 192.168.30.150 has about 8100 total connections at this moment. The ratio is definitely not 1:5. We can see the same symptoms on Photo 10 and Photo 11. The Total Connection ratio is not 1:5 during the whole time.

 

(Photo 9)

 

(Photo 10)

 

(Photo 11)

 

After the connection test finishes running (Photo 12), we can see the final Total Connections are 30000 as set. But pool member 192.168.30.100 has 6600 total connections and pool member 192.168.30.150 has 23300 total connections. The ratio is not 1:5.

 

(Photo 12)

How to use this snippet:

According to the test result, the difference between Ratio and Ratio Least Connection is:

 

The Ratio Load Balancing Method only makes sure the Total Connections are following the ratio value. The Current Connections (Active Connections) do not follow the ratio value.

 

The Ratio Least Connection Load Balancing Method only makes sure the Current Connections (Active Connections) are following the ratio value by using Least Connection method to trim connections as set ratio value. The Total Connections do not follow the ratio value.

 

Code :

No code snippet.

Tested this on version:

13.1

Updated Feb 22, 2022
Version 2.0

Was this article helpful?

No CommentsBe the first to comment