Forum Discussion

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

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




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 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,




3 Replies

  • 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:






  • Here's another related link from Hamish:





  • 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