Forum Discussion
Limit to the number of Rules for a Local Traffic Policy
Technically no, but you'd be braver than most if you applied more than a small handful. As I'm sure you're aware, iRules are (byte code) compiled when added to a VIP. Multiple iRules are mashed into a single iRule, and any same events are also aggregated into a single event. This is why the order of the iRules in the GUI (11.x) and the priority command are so important. With multiple iRules you have to take into consideration a few potential pitfalls:
-
Race conditions - are you attempting to read a variable in one iRule before it's set in another?
-
Logic faults - are you trying to do a redirect in one iRule and insert an HTTP header in another at the same time?
If the iRules are discreet and do not interfere with the logic of other iRules, and/or you've been very careful not to allow collisions, you can add as many iRules as you need. But also, given that there's a finite set of possible events, it's not likely (or perhaps wise) to go beyond that.
I would also add that, aside from specific use cases where you want some discreet action to happen in multiple VIPs but don't want to have to copy and maintain that code in multiple iRules, there's a lot to be said for simplicity. Aggregating all of your logic into a single iRule is usually the more maintainable option.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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