Forum Discussion
Deon
Nimbostratus
Jun 30, 2008When to iRule and when not to?
The task at hand today is a very simple redirect to an app login page when a user types only the host name and the uri is "/". The following code works. This is obviously super simple.
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "http://[HTTP::host]/MyApp/en/US/MyApp/Login.jsp"
}
}
There are no other iRules for this virtual server.
I see two ways to implement the redirect and am looking for feedback on which way is the the best route given that there are no other iRules for this VS.
1) Use above iRule. Looks at each and every request and redirects if uri is "/".
2) Create & package a simple rootredirect.war file with one (default) html page that does the redirect. Deploy this simple war on tomcat server.
Implementing the redirect with an iRule obviously creates overhead on the BigIP as each and every HTTP_REQUEST fires the (albeit small & simple) iRule to execute. The rootredirect.war approach does not incur such overhead but does create one addl war that needs to be deployed on the tomcat server.
So, given there are no other requirements that would require to look at each HTTP_REQUEST, would it be more desirable to implement the redirect at the tomcat server and save the processing cycles on the BigIP?
Am I splitting hairs and worrying about something I should not necessarily worry about?
Looking for the opinion of others here.
Thanks
-Deon
- hoolio
Cirrostratus
The overhead for parsing the HTTP headers and checking the URI is very minimal. However, if you have the ability to handle the redirect at the web server, it would be more efficient from the LTM perspective. - Deon
Nimbostratus
Thanks for the info. Yesterday I did an informal test by adding this rule with a bogus match string (so it would never redirect) to an existing virtual server with a LOT of traffic. I could not see any difference at all in response times nor in BigIP load. - hoolio
Cirrostratus
Hi Deon,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects