Forum Discussion

tb_93024's avatar
tb_93024
Icon for Nimbostratus rankNimbostratus
Dec 02, 2011

count sessions to a web page and redirect if too high?

Hi,

 

 

am quite new to irules, I have a client who is launching a large campaign and wishes to redirect to an alternate site if connections are higher than n but only to a certain page, eq example.com/pageinquestion. We must not redirect from other pages to this holding page as the holding page is specifically related to the campaign on that page.

 

 

The holding page would then instruct the client to retry every 30 seconds till they get a free connection. They currently have the webservers performing this in staging, the client would like to offload this functionality to the f5 (version 10.2.2).

 

 

Is this possible with an irule? Obviously we would need to be able to measure active connections and decrement the counter as a client disconnects, the site is currently set up with the one connect profile and a custom persistence profile of sticky source IP of 60 minutes. The loadbalancing method is currently set to round robin.

 

 

Thanks in advance,

 

 

 

  • Hi tb,

     

     

    You could count the sessions in a session subtable using the table command. If the request is to your white listed URI(s), you could not count the request. See the wiki page and this article set for details:

     

     

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

     

    http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=2375

     

     

    Aaron
  • Here's another related link from Hamish:

     

     

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

     

     

    Aaron
  • Hi Aaron,

     

     

    thanks for the swift reply, I will have a delve into the links you have supplied and see what I can come up with, it's all new to me as I am a Cisco person but I have managed a few simple irules so far (redirects and blocking certain user agents). I am not using any whitelists for the URI's so that should not be a problem,

     

     

    Thanks again

     

    Toby