Forum Discussion
johndegern_4568
Nimbostratus
Mar 29, 2010How many redirects can I have in a single iRule?
I have a project where I would like to use BigIP to redirect 200+ domains to different domains. Sometimes to a host::uri.
How many "If Else" can one have in an iRule? Would a better approach be to have separate iRules for each redirection?
I am very interested in using a best practice approach for this device and definitely don't want to put any major stress to a bustling production system.
Thanks in advance to the guru community.
- The_Bhattman
Nimbostratus
Hi John, - johndegern_4568
Nimbostratus
I probably should have specified the version in my first post. We're using BIG-IP 9.3.1 Build 37.1 and the link you provided is for v10. - hoolio
Cirrostratus
You could chain 200 if/elseif.../else together, but it would get a bit unwieldy. You could still use a datagroup in 9.3.1. But you'd use matchclass or findclass to search the class. ~200 lines shouldn't add a lot of overhead but it's always good to do performance testing if you can before using a rule like this in production. If the redirects are all of the same VIP, it would be best to combine the redirects in a single iRule. This helps you avoid attempting to send multiple redirects on the same request (which triggers a runtime TCL error). - The_Bhattman
Nimbostratus
Don't forget the SWITCH command (http://devcentral.f5.com/wiki/default.aspx/iRules/switch.html) - johndegern_4568
Nimbostratus
Thats what I started using rather than elseif statements. It works great!! Thanks
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