Forum Discussion
Matthew_Shaw_64
Nimbostratus
Aug 29, 2007LB::server pool behaviour clarification?
I have a simple iRule that tries to send requests for certain urls to a custom pool rather than the default pool associated with the virtual server:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/myapp" } {
pool "myapp_pool"
}
}
I have noticed that for a browser making requests to urls that both match and don't match /myapp, some of the non /myapp urls will go to the myapp_pool rather than the default pool.
This construct (which I've seen in some DevCentral posts) seems to work reliably:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/myapp" } {
pool "myapp_pool"
} else {
pool $default_pool
}
}
Is this the 'correct' way to ensure that the request goes to the correct pool?
Thanks.
- Colin_Walker_12Historic F5 AccountSetting a default pool like you are above in the CLIENT_ACCEPTED section probably won't achieve what you want it to, since the BIG-IP hasn't made a new load balancing decision yet, and you'll basically be setting the default_pool variable to whatever pool was selected on the last step through the rule.
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