Gauthier_Delac1
Apr 06, 2009Nimbostratus
Selective universal persistence
Hello,
I have an irule that selects a pool depending on the URI (actually, a pool contains cache servers and the second one contains web servers).
I need universal persistence based on JSESSIONID only for requests going to the web pool (Because I want to keep a good balance between cache servers)
So I've included these lines in my irule :
when HTTP_REQUEST {
[...Pool selection...]
pool $Current_Pool
if { $Current_Pool equals $Pool_NoCache } {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist uie [HTTP::cookie "JSESSIONID"] 60
}
}
}
when HTTP_RESPONSE {
if { $Current_Pool equals $Pool_NoCache } {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist add uie [HTTP::cookie "JSESSIONID"] 60
}
}
}
The [...Pool selection...] just contains stuff like
"if { [HTTP::uri] starts_with "/foobar" } { set Current_Pool $Pool_Cache }"
Persistence entries are fixed to 60 seconds for testing.
My problem is that this irule creates multiple persistence entries (for the same JSESSIONID, same VS and same pool) and, sometimes, going to different pool members ! (this is the real problem)
In consequence, a big majority of the requests comes from the same server, but some of them comes from the other one (the web pool contains 2 web servers)).
Here is a screenshot of my persistance table :
http://img7.imageshack.us/img7/5989/persist.jpg
And here is some log I've collected, showing IP::server_addr and HTTP::path
...: XXX.XXX.151.201 <= /VAD/HTML/Ressources/fr_FR/css/Header.jsp
...: XXX.XXX.151.202 <= /VAD/OubliMdp
...: XXX.XXX.151.201 <= /VAD/HTML/00-Header/minishopcart_nb_produit_panier.jsp
...: XXX.XXX.151.201 <= /VAD/HTML/00-Header/login.jsp
...: XXX.XXX.151.202 <= /VAD/ArticlesDejaVus
...: XXX.XXX.151.202 <= /VAD/HTML/00-MiniShopCart/MiniSC.jsp
...: XXX.XXX.151.201 <= /VAD/MiniShopCart
I think it's necessary to specify that my VS has a 255.255.255.255 oneconnect profile and this irule is affected to VS through universal persistence profile (I need Override Connection Limit feature).
The website contains some AJAX : this explains the presence of multiple JSP requests at the same time.
Does anyone see what's wrong into this ? I've searched a long time in the forum before posting but I haven't seen someone having the same problem...
Thanks a lot !