Forum Discussion

Andy_Herrman_22's avatar
Andy_Herrman_22
Icon for Nimbostratus rankNimbostratus
Oct 17, 2007

Least Connections/Fastest lb methods

Apologies for the length, but the situation is a bit complicated and I tend to be verbose.

I have a couple questions related to the Fastest and Least Connections load balancing methods that I can't find answers to in the manual.

First, some basic info on our setup. We have a few servers running Apache Tomcat which we're trying to load balance. The application that these serve uses multiple protocols, HTTP, HTTPS, and a custom direct-socket connection. To accommodate this we have multiple pools, one for each port/connection type, each with their own sets of nodes.

So, for example, an HTTP pool containing nodes for each of the servers on port 80 and a virtual server on port 80, and another pool for port 9080 with nodes for each of the servers on port 9080 and another virtual server on the same port.

Since the same client can use multiple connection types in the same session we have persist across virtuals enabled. Currently our pools use the Dynamic Ratio lb method, though the ratios are currently never changed.

We're looking at switching to either the Observed or Predictive load balancing type, which both appear to be built off of the Fastest and Least Connections types, but I'm not sure if this will work properly.

Both Fastest and Lead Connections types seem to be either localized to a single pool, or to the nodes in the pool. How does this work when there are multiple nodes per server?

For example, say you're using the Least Connections type and you have this setup:


                   / Node1A -> Server1
VirtualA -> PoolA <
                   \ Node2A -> Server2
                   / Node1B -> Server1
VirtualB -> PoolB <
                   \ Node2B -> Server2

Now, say you have the following connection counts:


Server1: 75
  Node1A: 50
  Node1B: 25
Server2: 200
  Node2A: 10
  Node2B: 190

What happens when a new connection comes in? The desired behavior is that any new connection, regardless of virtual server, goes to Server1, as that's the one under the least load. However, if it only looks at the node values, not the overall for the server, a new connection on VirtualA would be sent to Server2, as Node2A has less connections than Node1A.

Same applies to the Fastest method. Does it look at just the node's response, or does it look at the overall response from the server the node points to (all nodes for the same server)?
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Depends whether the IP:port combo is the same or different for the same server across pools.

    You can aggregate stats from multiple instances of the same IP:port combo ("node") for LB decision making by selecting the LB methods with "node" specified as part of the method name.

    If IP:port varies per server instance on the same node, there is no other way for LTM to know they are on the same physical server.

    So you could do it if your pools were built like this:

    
                       / Node1A -> Server1 - 10.0.0.1:80
    VirtualA -> PoolA <
                       \ Node2A -> Server2 - 10.0.0.2:80
                       / Node1B -> Server1 - 10.0.0.1:80
    VirtualB -> PoolB <
                       \ Node2B -> Server2 - 10.0.0.2:80

    but not if they are built like this:

    
                       / Node1A -> Server1 - 10.0.0.1:80
    VirtualA -> PoolA <
                       \ Node2A -> Server2 - 10.0.0.2:80
                       / Node1B -> Server1 - 10.0.0.3:80
    VirtualB -> PoolB <
                       \ Node2B -> Server2 - 10.0.0.4:80

    HTH

    /deb