Forum Discussion
Mike_S_59924
Feb 23, 2011Nimbostratus
irule to do smarter cookie persistance
I have a very interesting dilemma. We inherited through acquisition an application w/ some very strict persistence requirements. Not only must a user stick to the same load balanced web server but that web server must communicate via web services to the same application server through the length of the session. The number of web and applications servers varies throughout the year as they add more during busy periods. They accomplished this before the acquisition with a Cisco CSS load balancer. Essentially I need to make this work w/ no application changes or there will be pressure to put a Cisco on our network (I'm trying very hard to avoid this).
The browser to web box was easy as a simple cookie insert persistence profile did the trick. THe Web to application part of this was not working consistently with this option. Upon investigation, it seems that the LTM is not consistently creating the cookie. As this is done via web services in code, I don't really know how to investigate plus if the investigation turns up a coding change requirement, it might be shot down. They then informed me that they had this same issue w/ Cisco and instead of figuring out why, they just created a custom cookie w/ the server name in it that they set and told the Cisco to use that for persistence.
I tried the LTM option for this of cookie hash and it didn't work. I then read about the hash and was blown away by F5's reasoning that this was a realistic way to do persistence. It seems the CRC32 value of the cookie mod (number of servers in pool) must be unique and ordered for this will work. Else no go. Sheesh. Again asking for them to make changes to the code will probably result in pressure to put the Cisco device on the network.
I read about Passive but it seems for that to work, they will have to change code for the custom cookie to return the value that maps to IP's and Ports in the same way as the LTM does. ie. code change again.
So basically 2 questions.
given a custom cookie that looks something like this: customcookie=xxservername , would any of the LTM cookie persistence options have the desired effect?
If not.
Any suggestions for an irule that would accomplish what I want? One small twist is that I would like the irule to clear the cookie and and start session over if the node went down.
Thanks in advance!!!
- hooleylistCirrostratusHi Mike,
- Mike_S_59924NimbostratusThanks for the response. Unfortunately there is no appetite for a research project for an issue that was supposedly researched years ago w/ no avail and a quick fix (employing the Cisco). I really would like a simple cookie way of doing this based on a server based cookie and the LTM play in this space (the cookie Hash) is the most absurd thing I've ever seen.
- hooleylistCirrostratusLet me confirm the scenario. Do you have a two tiered web app with a web tier and app tier? Do both sets of requests (from client to web and web to app) need to be persisted to the same servers? If so, you could potentially use an iRule on the web to app virtual server which persists based on the client's web virtual server persistence cookie. You could use 'persist uie $web_vs_cookie_value' to do this in HTTP_REQUEST. With this or any other layer 7 per HTTP-request persistence method, you'll need a OneConnect profile for each virtual server.
- Mike_S_59924NimbostratusAarrn,
- Mike_S_59924NimbostratusGood news. The Oneconnect profile has appeared to fix the issue subsequent to some more load testing. I take it you reccomend putting that on any Virtual Server w/ cookie persistence? For some reasons we've never had persitence issues with just plain cookie for our Internet facing Web Servers.
- hooleylistCirrostratusHi Mike,
- hooleylistCirrostratus
...
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