Forum Discussion
Jeff_Wyant_4852
Nimbostratus
Jun 14, 2006Direct a % Traffic to Two App Pools
Currently all web traffic goes to one app pool for our current web site. We are in the process or changing our web site and for testing purposes I need to write an irule that would direct a % of traff...
Jun 14, 2006
You could do this with a counter.
when RULE_INIT {
initialize the global counter
set ::request_num 0
}
when HTTP_REQUEST {
Increment the counter
incr ::request_num
if { $::request_num < 10 } {
request 1-9 will go to poolA
pool poolA
} else {
the 10th request will go to poolB
pool poolB
Reset the counter
set ::request_num 0
}
}Basically this will keep a request counter. For the requests 1-9 it will use poolA (90%). For the 10th request (the other 10%) it will use poolB and then reset the counter.
I'm sure there are other ways to do this but this should get you started.
-Joe
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
