Forum Discussion

wowchens's avatar
wowchens
Icon for Nimbostratus rankNimbostratus
Nov 12, 2009

Load balance based on backend connections

Hello All: I have a requirement with one of my clients for LTM to load balance 4 IIS servers based on the number of available MQ connections that each server has. There is a limit of the number of connections and we have to balanced incoming requests based on that number. Number of available connections can be obtained by running a GET /availalbeconns.asp and it returns the number. I am trying to figure out how this can be achieved, not sure if we should use WMI or an iRule or an external script. Also we have to keep the sessions persistent which I have been able to do but I am not able to keep the connections balanced equally to match the MQ number.

 

 

Any help is greatly appreciated.

 

 

Thanks.

4 Replies

  • Hi Chenna,

     

    Have you looked at the following

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/ASP_SessionID_Persistence.html

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/Weblogic_JSessionID_Persistence.html

     

     

    This might give you better idea at how to write up an irule based on MQ Connection - that is, if it passes that information in a cookie header or hTTP headers.

     

     

    CB

     

  • Hello CB: Thanks for your inputs. My requirement is more on load balancing than persistence. I am trying to figure out how I can use that MQ count as a mechanism to load balance. I am able to achieve persistence without any issues, its just that I am not able to tap into that specific monitor.

     

     

    In other works, I need some thing like this, if at all possible.

     

     

    When HTTP_REQUEST {

     

    do a GET to /availableconn.asp on all nodes and save counts in an array

     

    LB::node with least connections

     

    }

     

     

    I am able to create the array just fine but I am not able to do the GET and store it.

     

     

  • Could you poll the servers with SNMP to get the count of available MQ connections? If so, you could use the SNMP DCA Base monitor and agent to collect the metrics and increase the ratio for servers which have more available MQ connections.

     

     

    It might be possible to do something similar with WMI. But I'm not sure whether you could get the MQ connection count using WMI.

     

     

    Another option would be using an iControl app (possibly running on LTM itself) which polls the /availableconn.asp page and marks the pool members up or disabled (Only persistent or active connections allowed) if the available connection count is too low.

     

     

    You could potentially try to check the /availableconn.asp page using HTTP::retry as described in this article from Deb (Click here), but I think that would be expensive in latency to try to do on every request.

     

     

    Aaron
  • Thanks Aaron. I will some more research into the iRule from Deb's article. I think I got some leads that I can work off of. I'll post my results as soon as I test them. Appreciate your time.