Forum Discussion

Amar_A_361783's avatar
Amar_A_361783
Icon for Nimbostratus rankNimbostratus
Nov 13, 2018

How does least connect method works ?

How does least connect method works in the following scenario:- Multiple VIPS (ex-4), all are listening on different ports. So if least connection is applied on each vserver. How is lb supposed to perform load balancing . So, is it connection checks is done based on VIP level or node level ?

 

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus

    The check is performed against pool members or node depending on whether you have chosen Least Connection (member) or Least Connections (node).

     

    So when the LB decision is made the poolmember OR node with the least number of connections will be chosen.

     

    In least Connections (member) the number of connections to the node isn't considered. Look in the admin guide (Google is your friend here) for an overview of load balancing methods and how they work, or the help in the GUI...

     

  • 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 :)