Forum Discussion
Chris_Klomp_115
Nimbostratus
Jul 25, 2013Multiple iRules for one server
Still fairly new to iRule programming. :-)
If I have two iRules working on an HTTP Request.
Can I apply them both to the VS or do I need to merge them into one rule?
And if you can apply both, what rule will be processed first?
Thanks, Chris.
2 Replies
- Jnon
Nimbostratus
You can leave it as one rule or multiple. The will both execute at the same time. For example If you have when http request in each I rule both of those events have to be executed during http request. You can add a priority if you want one to execute in specific order. Be careful of irules using the same variables or selecting default pool. - Kevin_Stewart
Employee
If I may add, iRules look like scripts but they're actually "compiled" when updated. This compilation optimizes the events and commands, as much as possible, for optimal runtime. Should you have multiple iRules applied to a VIP, they are effectively combined. If you have multiple iRules applied to a VIP that have the same events, those events are also combined. You would use the priority option in the event declaration to specify the order of commands within the single compiled event.
As J states, with multiple iRules you should to be mindful of both the order of events and commands, and when variables are both created and used (ie. don't try to use a variable in one iRule that hasn't yet been created by another).
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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