iRule Persistence

Hi,

I am hoping someone can help? I am having trouble keeping persistence when redirecting to a new pool group.

The setup I have at the moment is:

VIP

Pool - 2 nodes

iRule

when HTTP_REQUEST {

Check the URI, set to lowercase

persist cookie

switch -glob [string tolower [HTTP::uri]] {

“/Folder*” -

“/Folder2/*” -

“/Folder3/*”

{pool HTTPS-ThirdPartyApps} 2 nodes

}

}

When users are filling in the forms under the HTTPS-ThirdPartyApps pool they are being bounced between the 2 servers rather than sticking to one of them.

My questions are:

1. Is there anyway to keep the session to one server?

2. Would I be better using an HTTP Class? And if I did this, would it keep the session persistence?

Thanks for your help

Nick

if you want to persist to HTTPS-ThirdPartyApps pool only, why won’t you enable persistence only when the pool is selected?

e.g.

[root@ve10:Active] config  b rule myrule list
rule myrule {
   when HTTP_REQUEST {
   persist none
   switch -glob [string tolower [HTTP::uri]] {
      "/folder*" -
      "/folder2/*" -
      "/folder3/*" {
         persist cookie
         pool HTTPS-ThirdPartyApps
      }
   }
}
}

have you seen this sol?

sol7964: Persistence may fail for subsequent requests on Keep-Alive connections

and in the real irule, F (folder) is in lower case, isn’t it?

hope this helps.

Hi,

Thanks for your reply. I need persistance on the Pool members under the VIP and persistence on the HTTPS-ThirdPartyApps pool under the iRule

I assumed the default persistence profile would deal with the pool under the VIP? If this is the case then I could just use the persist cookie when the iRule pool is selected, but having he persist cookie at the top of the iRule should of worked as well should it not?

And yes the URI’s are in lowercase in the actual iRule.

I hadn’t seen that article before, so I will look into that method as well. Thanks for the link.

I assumed the default persistence profile would deal with the pool under the VIP? If this is the case then I could just use the persist cookie when the iRule pool is selected, but having he persist cookie at the top of the iRule should of worked as well should it not? yes, i think so.

I hadn’t seen that article before, so I will look into that method as well.can you try oneconnect profile? if it still does not work, can you capture packet or add some log command to see what is going on?