Forum Discussion

satnash_230209's avatar
satnash_230209
Icon for Nimbostratus rankNimbostratus
Aug 20, 2018

Cookie Persistence Records are not removed from persistence table after persistence idle timeout or iRule timeout expires

Persistence records for Cookie or Universal persistence do NOT seem to be removed from memory. I have a setup where i have universal persistence set up using a server specific COOKIE_NAME. When all nodes are up, i have the required unique persistence record:

 

COOKIE_NAME_1 --> Server Node 1 COOKIE_NAME_2 --> Server Node 2 COOKIE_NAME_3 --> Server Node 3

 

When Server Node 2 fails a health check, clients responding to Server Node 2 are load balanced temporarily incorrectly,

 

COOKIE_NAME_2 --> Server Node 1

 

The clients getting redirected to the above record are rejected (Server requires Client to the same Server for the duration of the session where they can be multiple request responses) Clients retry and are given a new COOKIE_NAME (1 or 3s) and all is fine.

 

The issue occurs when the above incorrect persistence does not age out even after persistence timeout, set to 120 seconds, after which no clients are talking to Server Node 2 and hence no COOKIE_NAME_2 being sent to the devices

 

If Server Node 2 now passes healthchecks and sends client COOKIE_NAME_2, the LB now persists that record to Server Node 1, COOKIE_NAME_2 to Server Node 1.

 

I had to manually delete ltm persistence rule from memory in between the node being down and up, for the whole thing to work correctly.

 

What config needs to be added in addition to the default timeout of 180 seconds, and the iRule persistence time I specify of 120 seconds for the cookie persistence records to be removed from memory ??

 

Any help or guidance is greatly appreciated. IRule is simple enough, used below:

 

when HTTP_REQUEST { Check if there is a ACS_ID cookie if { [HTTP::cookie "ACS_ID"] ne "" }{ Persist cookie value for 2 mins persist uie [string tolower [HTTP::cookie "ACS_ID"]] 120

 

} } when HTTP_RESPONSE { Check if there is a ACS_ID cookie in the response if { [HTTP::cookie "ACS_ID"] ne "" }{ Persist the cookie value with a timeout of 2 mins persist add uie [string tolower [HTTP::cookie "ACS_ID"]] 120 } }

 

1 Reply

  • First off, you aren't using Cookie Persistence, you are using Universal Persistence, with a key value retrieved from a cookie.

     

    Are you are using the iRule directly on a VS, or if you have the rule associated with a persistence profile (which itself is then associated with a VS)? If you aren't doing the latter, I would suggest dropping the timeout values from the iRule and associating the iRule with a persistence profile configured on the VS.

     

    Universal Persistence is explained here.