Forum Discussion
How does least connect method works ?
Hey Amar
Are you reffering to GTM or LTM?
LTM
Load Balancing on LTM operates at the pool level. You will create one VIP and assign it a pool. The pool itself will contain multiple pool members. They all can have different ports. For example:
- VS 1: 10.10.0.100:80
- Pool 1:
- Pool Member 1: 172.16.1.1:80
- Pool Member 2: 172.16.1.2:80
- Pool Member 3: 172.16.1.3:80
When you configure load balancing for Pool 1, you can choose either Least Connections (Member) or Least Connections (Node). When choosing Least Connections (Member), load balancing will be based upon the Least Connections for IP+Port. Meaning, it will only look at pool member specific data, in other words
- 172.16.1.1:80
- 172.16.1.2:80
- 172.16.1.3:80
Now we add another Virtual Server that re-uses the nodes as new pool members with different ports:
- VS 1: 10.10.0.100:443
- Pool 1:
- Pool Member 1: 172.16.1.1:443
- Pool Member 2: 172.16.1.2:443
- Pool Member 3: 172.16.1.3:443
If we continue to use Least Connection (Member), the load balancing for VS1 (Pool 1) will only take into consideration the connections for the following pool members:
- 172.16.1.1:80
- 172.16.1.2:80
- 172.16.1.3:80
In this case we do not care how many connections we have towards the 443 pool members.
Here is an example:
Least Connections (Member)
- 172.16.1.1:80 - Connection Count: 20
- 172.16.1.2:80 - Connection Count: 10
-
172.16.1.3:80 - Connection Count: 5
-
172.16.1.1:443 - Connection Count: 2
- 172.16.1.2:443 - Connection Count: 5
-
172.16.1.3:443 - Connection Count: 50
-
172.16.1.1 - Connection Count: 22
- 172.16.1.2 - Connection Count: 15
- 172.16.1.3 - Connection Count: 55
Member Chosen: 172.16.1.3:80 (This is the member with the least connections)
If we instead change the load balancing method to Least Connection (Node), it will consider the connections to the entire node, meaning:
- 172.16.1.1
- 172.16.1.2
- 172.16.1.3
For example:
Least Connections (Node)
- 172.16.1.1:80 - Connection Count: 20
- 172.16.1.2:80 - Connection Count: 10
- 172.16.1.3:80 - Connection Count: 5
- 172.16.1.1:443 - Connection Count: 2
- 172.16.1.2:443 - Connection Count: 5
-
172.16.1.3:443 - Connection Count: 50
-
172.16.1.1 - Connection Count: 22
- 172.16.1.2 - Connection Count: 15
- 172.16.1.3 - Connection Count: 55
Member Chosen: 172.16.1.2:80 (This is the node with the least connections)
To summarize:
Least Connections (Member) - The least connections to the application (HTTP, HTTPS etc).
Least Connections (Node) - The least connections to the node (the entire server).
GTM
Traffic will again, only be load balanced on the pool level. For GTM, the Least Connection works in similar manner but here we do not have Member or Node specific settings. The members of the pool are virtual servers residing on other LTMs. When it receives a request, it will look at the current connection count, and the virtual server with the least connections will be the IP address in the DNS response back to the client.
I hope this cleared things up as I'm not entirely sure I completely understand your question.
Let me know if you have any follow-up questions :)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com