Forum Discussion
AVF_7351
Nimbostratus
Jun 22, 2010Stateless session persistence
Hi,
I'm trying to set up session persistence in such a way that it doesn't depend on a state table in LTM. This is so that persistence will work when a client moves to a different LTM, when the LTMs aren't in a cluster. (This is for OSPF failover, but this is irrelevant.)
What I basically want to do is to insert (an obscured version of) the backend server's IP into a cookie and then persist just by going to whatever server is specified in the cookie (with some logic to handle the server going down).
Before I go on, maybe I should just ask at this point: how would I do this? I'm new to F5, and in some cases, I can make something work, but it just feels wrong, so I'd rather not share my code at this stage.
I've tried creating a universal persistence profile with a rule that looks at the cookie and says "pool [ LB::server pool ] member $foo". However, I also have a rule which selects a pool based on the URL. With this set-up, the persistence rule runs first and the result is that it's messed up when the pool selection rule says "pool foo".
The way I got it to work is by having no persistence profile and just attaching the persistence rule to the vserver, and making it run after the pool selection rule.
However, this just feels Wrong. It also won't be very transparent when someone else comes to look at the config (this is something we were really hoping to achieve by replacing our old load balancers with F5).
Another related question: what is the difference between "pool $pool member $member" and "LB::reselect pool $pool $member"?
I'd be very grateful for any suggestions.
Alex
- hoolio
Cirrostratus
That makes sense. The cookie name for the cookie insert persistence profile would need to be the same across each LTM unit for this to work. - L4L7_53191
Nimbostratus
Assuming that the pool name is different across pairs, you're right Aaron. If they are the same across pairs, it should match with something like BigIPServercookie_poolName if I am not mistaken... - Michael_Yates
Nimbostratus
In the event of a failover, traffic would have to use the same hostname in order for the F5 Session Cookie to be used, have the same pool name, and the server would need to be available on the same port number: - Michael_Yates
Nimbostratus
BIGipServer=..0000
- AVF_7351
Nimbostratus
> The algorithm to extract this value from the cookie is the same across BigIPs so it - hoolio
Cirrostratus
Hi Alex, - AVF_7351
Nimbostratus
Thanks Aaron. - AVF_7351
Nimbostratus
It looks like I'm hitting the same bug as in - L4L7_53191
Nimbostratus
Alex: I'm not entirely sure that this is actually a bug. To me, the behavior you see makes sense: the persist cookie's value is an encoded string that maps to an ip:port combinantion - in other words, a 'node'. By specifying a reselect, node, or pool statement first you're explicitly telling BigIP to send the traffic to a destination as opposed to letting it defer to the cookie's value for this. - hoolio
Cirrostratus
I think F5's perspective on using the persist command with explicit node or pool member selection is that the iRule should handle the persistence if it's handling the load balancing. So I think it will be a bit of an uphill battle to get the LTM behavior changed. You can manually set a cookie for persistence when you're manually selecting a pool member following the logic outline in this post:
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects