Forum Discussion

Chris_Miller's avatar
Chris_Miller
Icon for Altostratus rankAltostratus
Jul 30, 2010

Efficient way to set variable here?

Syntax aside, here's what I'm trying to do: Virtual Server can send traffic to multiple pools. In this case, pool A and pool B set A [current connections pool_A/active_members pool_A] set B [current connections pool_B/active_members pool_B] set C to whichever is smaller, A or B pool pool_$C

3 Replies

  • Hi Chris,

     

     

    You'd need to track the current connections by incrementing a counter in LB_SELECTED or SERVER_CONNECTED and decrement it in CLIENT_CLOSED. The math would be pretty simple after that using the expr and active_members commands.

     

     

    Aaron
  • Thanks Aaron - I'm somewhat surprised we don't have a "current_connections" command yet since LTM is already tracking that as a stat.

     

     

    Ah well.
  • You're not the only one. I'm not sure why VS and pool connection stats aren't exposed in iRules. It might be worth a case with F5 Support to find out why.

     

     

    Aaron