Forum Discussion
Kevin_Stewart
May 01, 2013Employee
If I may interject with a few comments, to Steve's original statements, when used in CLIENT_ACCEPTED, the [LB::server pool] command returns the default pool of the VIP before it could have been changed by an iRule, HTTP class or other method. It's also good practice to use this structure when doing this kind of dynamic, real-time pool selection because pool selection is generally "sticky" within a TCP session. In other words, if multiple HTTP requests come through a single TCP session, a single pool statement will force all subsequent requests down that path. You might also be experiencing, as Nitass suggests, multiple requests for different objects within the page that don't meet your pool selection criteria.
Please try this modified version of your iRule and review/report the results:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
log local0. "default pool = $default_pool"
}
when HTTP_REQUEST {
log local0. "uri = [string tolower [HTTP::uri]]"
if { [string tolower [HTTP::uri]] ends_with "test=64" }{
log local0. "first condition"
pool test-temp
} elseif { [string tolower [HTTP::uri]] contains "test=64&" }{
log local0. "second condition"
pool test-temp
} else {
log local0. "default condition"
pool $default_pool
}
}