02.10
Sorry folks, but you just have to have a horrible pun thrown at you from time to time! All joking aside, today I worked on resolving a persistence issue to a few Citrix gateways that are load balanced by a BIG-IP® 6400. I discovered that it is possible to use both a default persistence profile and to specify persistence in an iRule, all on the same Virtual Server.
Bearing in mind that I have the “Default Persistence Profile” set to use a profile other than cookie, here is the iRule that I wrote:
when HTTP_REQUEST {
set header_uri [string tolower [HTTP::uri]]
if { [matchclass $header_uri starts_with $::aaa_uri] } {
pool aaa_Pool
} elseif { [matchclass $header_uri starts_with $::bbb_uri] } {
HTTP::redirect "https://bbb.companyname.com/bbb/main/Main.jsp"
} elseif { [matchclass $header_uri starts_with $::CITRIX_uri] } {
persist cookie insert "CITRIX_Cookie" "0d 03:00:00"
pool CITRIX_Pool
} else {
pool ccc_Pool
}
}
The command persist cookie insert “CITRIX_Cookie” “0d 03:00:00″, tells the BIG-IP® to create a cookie named CITRIX_Cookie, give it a duration of 3 hours and insert it into the header of traffic going to the CITRIX_Pool. If traffic going to that pool already has the CITRIX_Cookie in its header then persist the connection to the same pool member that it used last time.
Traffic going to the rest of the pools will use whatever persistence method is set in the “Default Persistence Profile”. It is also possible to disable persistence to pools by using the persist none command.
We have a situation where there are two web servers in a load balanced sitaution. The initial load balancing does fine and we use cookie persistence, but during an action on the web site a user may invoke an AJAX based page which does not take part in that same cookie and this causes a problem when that page comes from the other server. Is there a way through i-Rule or using another persistence profile that we can make this maintain on the same web server that the original session is created?
You should probably use “One-Connect” or use “LB::detach” command in the iRule to inform F5 to load balance based on each request instead of the default load balancing per TCP Connection.