Forum Discussion
Perry_71428
Nimbostratus
Mar 12, 2009Global variables question
Hi
In the following rule from the CodeBase, is there a way that ::max_active_clients can be changed without the RULE_INIT being fired? When RULE_INIT gets fired the ::total_active_clien...
hoolio
Cirrostratus
Mar 16, 2009It looks like a good understanding of how to handle global variables in multiple iRules. You need to name them uniquely in all iRules to prevent trampling. If you've intentionally named them the same so you can configure one iRule from another, you only need to set the global variable in one iRule. As the global variable can be referenced from any iRule on any virtual server, the rule doesn't need to be added to any specific virtual server. Though, to make it simpler for someone else reading your iRule it might be clearer to explicitly set it in the request limiting iRule on each virtual server, as well as the "configuration" iRule:
vs1_limit_rule
when RULE_INIT {
This max is set here and in the set_max_limits_rule iRule
set ::vs1_max 1000
}
when HTTP_REQUEST {
Rest of iRule code...
}
vs2_limit_rule
when RULE_INIT {
This max is set here and in the set_maxes_rule iRule
set ::vs2_max 2000
}
when HTTP_REQUEST {
Rest of iRule code...
}
set_max_limits_rule
when RULE_INIT {
This max is set here and in the set_maxes_rule iRule
set ::vs1_max 1000
set ::vs2_max 2000
}
Aaron
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
