Forum Discussion
Rick_110395
Nimbostratus
Jan 11, 2012Pool Persistence while buiilding the page
I have an iRule that selects a pool based on the URI, but as the page is built subsequent requests do not match the initial condition directing it to the same pool. How do I get the conversation to stick to the original pool it was sprayed to?
Running 10.2.2 HF3
The initial request goes to test-pool-5002 because the URI contains "Test", but as the login page is built the browser makes several additional HTTP requests that do not contain "Test" which then get sent to prod-pool-5001.
when HTTP_REQUEST {
set uri [HTTP::uri]
if { $uri contains "Test" } {
pool test-pool-5002
} else {
pool prod-pool-5001
}
}
Pools
pool test-pool-5002 {
lb method member observed
action on svcdown reselect
monitor all tcp
members 10.20.20.70:5002 {}
}
pool test-pool-5001 {
lb method member observed
action on svcdown reselect
monitor all tcp
members 10.20.20.70:5001 {}
}
I have tried using cookie persistence with no luck. Is there a way to do this without splitting it out into two virtual servers? I am open to any solution.
3 Replies
- Colin_Walker_12Historic F5 AccountThere are a couple of ways around this. Persistence of some form (cookie, IP, etc.) should do the trick as once the pool is chosen the client should stick there throughout their connection. That should be the simplest way to go about things. I'm surprised you tried cookie persistence with no luck. What did your config look like? What was the behavior? Were there any errors showing in the logs?
The other thing that is likely worth changing is the logic of the rule. If prod-pool-5001 is the default pool for all traffic that isn't going to the /Test page, then why include it in the iRule? Why not make it the default pool for the virtual, and leave it out of the iRule statement completely. This might make your persistence a little more ... persistent.
Colin - hoolio
Cirrostratus
There's a related example for persisting across pools in this thread:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2158969/showtab/groupforums/Default.aspx2234700
Aaron - Rick_110395
Nimbostratus
Try tried changing my iRule and just adding the prod-pool-5001 as the default pool, but got the same results
when HTTP_REQUEST {
set uri [HTTP::uri]
if { $uri contains "Test" } {
pool test-pool-5002
}
}
I am going to try an iRule like the one in other thread.
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