Forum Discussion

JT_46093's avatar
JT_46093
Icon for Nimbostratus rankNimbostratus
Dec 23, 2011

iRule using web service for LB decision

Hi,

 

 

I want to write an iRule that contacts a web service to find out which back end server to send the connection to. I know this would not be fast but the connections I'm balancing are long lived connections so a slower intial connection is not a problem.

 

 

I was hoping to use the features in TCL to do this. Notably...

 

http://tmml.sourceforge.net/doc/tcl/http.html

 

 

The idea was to contact the web service on CLIENT_ACCEPTED.

 

Process the response from the web service to find the server and port to use

 

use the node command to define the back end machine the BIG-IP will send the traffic to

 

 

The traffic being balanced is not HTTP, just TCP. So the only HTTP involved is where the irule is acting as a web client to the web service to find out the machine to use.

 

 

When I have tried this it seems that the http parts of TCL are not available in iRules. Is this right? Can anyone think of a way to do this?

 

 

Thanks

5 Replies

  • is sideband usable?

     

     

    sideband wiki

     

    http://devcentral.f5.com/wiki/iRules.SIDEBAND.ashx

     

     

    v11 iRules: Intro to Sideband Connections by Colin

     

    http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1086484/v11-iRules-Intro-to-Sideband-Connections.aspx
  • Thanks for the quick response.

     

     

    Yes I think sideband would do it. However I don't have a version 11 BIG-IP :-(
  • what about this one?

     

     

    Conditioning iRule Logic on External Information - 01 - HTTP::retry by Deb

     

    http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/105/Conditioning-iRule-Logic-on-External-Information--01--HTTPretry.aspx
  • Yes I had a look at that but unfortunatly the connection I'm trying to balance isn't HTTP so I have no way to trigger the HTTP events of HTTP::retry.
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Could the web service be made to respond to a DNS query with the information needed? If so we could use the RESOLV::lookup command to fire off a request and then you could act on the response.

     

     

    Just a thought. :)

     

     

    Colin