Forum Discussion
William_Them_99
Nimbostratus
Mar 01, 2006Changing pool from the default
We have a virtual server with a default pool. For certain URIs on this virtual server, however, we need it to use a pool other than the default.
We have used the "pool" command after ...
unRuleY_95363
Mar 01, 2006Historic F5 Account
Since this is a confusing topic, I thought I would try to give some more explanation. At one point, we actually had numerous discussions about how/when the selection might get reset back to the default pool. However, the conclusion of those discussions were that it was pretty much impossible to determine all the cases when the user would want this behavior and when they wouldn't.
The default pool is merely the pool that is initially selected upon receiving the client connection. All subsequent pool selections must be explicitly made. So, since HTTP can make multiple requests on a single connection, the subsequent requests may end up going to whatever pool the previous request might have chosen. Since this is case, it is always best to have an explicit case for all requests.
It's also important to understand that using OneConnect also has an impact on how this behavior works. If there is not a OneConnect profile, then each request on a connection will continue to use the same load-balanced pool member as the last request unless the pool selection has actually changed. If there is a OneConnect profile, then each request will be re-load balanced to a new pool member (within the currently selected pool). You could also use the LB::detach command to force the same behavior as happens with the OneConnect profile, however this has more to do with the load-balanced pool member than with the selected pool.
This is done this way because there are a number of examples where it is impossible to know when connection should be reset to the default pool. HTTP is only the simple case and iRules where made to handle many cases like dealing with custom protocols where it's up to the rule to define when the connection should be detach or a new pool selected.
I'll finish with reminding everyone that you can select a pool several times and that the last pool selection is always the one that is used. So, it is very easy to simply add a pool command at the top of the HTTP_REQUEST event to resets to the default pool. Here is a generic example of how to do this for any virtual:
when CLIENT_ACCEPTED priority 900 {
set default_pool [LB::server pool]
}
when HTTP_REQUEST priority 100 {
pool $default_pool
}
This rule could be used in combination with any other rule and would have the behavior of resetting each subsequent request to whatever the default pool is for the virtual server.
Good luck.
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