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!!!