Forum Discussion

Antonio_349's avatar
Antonio_349
Icon for Nimbostratus rankNimbostratus
Jul 05, 2016

Use Datagroup like a Pool

Hi all, I have a Datagroup with 2 values: - IP Address of Servers; - Value of Server Loads.

 

Is there a way to load balance connections to these Datagroup Members (related to their Servers Load)?

 

In other words, is there a way to use a Datagroup like a "Pool" for Load Balance connections directed to a Virtual Server? If yes, do you have some examples to do it?

 

Thanks

 

4 Replies

  • Unsure on what you're trying to achieve - What is a "Servers Load" ? The server Capability ?

     

    Could you not accomplish this by using Ratio based Load balancing ?

     

    • Antonio_349's avatar
      Antonio_349
      Icon for Nimbostratus rankNimbostratus
      My target is: - Application Server (where connections will be balanced) will write a Datagroup with Powershell (iControl); - Datagroup will be compiled with two values: IP Address of Application Server and one Value (from 1 to 5, where 1 is "server with low load" and 5 is "server with high load"). - F5 have to load balance connection using this Datagroup like a Pool. Is it possible to do this? I need to do and iRule to load balance based on this Datagroup.
  • I feel this is quite complicated way of distributing the load. Have you tried the simple methods first and failed ? My recommendations are "Least Connections (Member)" for starters and then try the Predictive method. Utilize OneConnect if you want to load balance HTTP Requests instead of connections.

     

    If you still insist on using datagroup, this is a rough iRule for starters:

     

    when CLIENT_ACCEPTED {
    if { [class search -value CLASS_DATAGROUP] eq "1" } {
    set IP [class search CLASS_DATAGROUP]
    node $IP 80
    }
    }

    I would like to warn that using node in iRule can break certain persistence function and has caused trouble when upgrading between 10.x and 11.x code version.

     

  • As @Odaah says, the use of a dynamic LB method should be preferred if one of them addresses your need. You mention that you want to use load information. If they can be can be exposed via SNMP, the the Dynamic Ratio method (together with a properly configured monitor) can do that:

     

    If this must be done statically, it would probably be better to use the Static Ratio method, then use iControl (which can be accessed using PowerShell) to periodically modify the pool ratio configuration. (I assume you want to ratio LB, but if you simply want to send all traffic to the "least loaded" server, you could also use priority group activation and use iControl to modify priority group membership). This approach is probably better because the built-in method will perform better than an iRule, and it quite a bit simpler.