Forum Discussion
torisan_93696
Nimbostratus
Apr 10, 2007Feasibility : Session Persistence based on URI parameters
Hi,
being new to F5 devices and iRules I have the following use case + question(s):
Use Case: We want to load balance requests (simple RR) but have session stickyness (persistence) based on certain parameters (a session is identified by three parameters). Using cookies or a designated session-id parameter is not an option (unfortunately). All this is with a BIG-IP 9.4.0 Build 517.5.
Idea: use an iRule to access the values of the URI parameters and then persist the node assignment based on a hash calculated off those three parameters. Persisting needs to be done once only, after that the the sticky assignment should be known to the balancer.
The basic idea for this to work would be something like that:
EVENT arrives {
get URI parameters
calculate hash from parameter values
check whether for this hash there a persistent node assignment already
IF yes {
let load balancer proceed based in the persistent assignment already there
} ELSE {
assign to a node
}
}
Question 1: Could it generally work like this?
Question 2: There are hash and universal persistence strategies in the divice which are not really much documented - can anyone tell me how to fill these with life for my purpose?
Questions 3:
- If ever it could work like this, which events would I have to use in the iRule? I assume HTTP_REQUEST, but LB_SELECTED sound also interesting - Will I be able to access HTTP specific variables in the LB scope? Thinking about my use case it could even be worthwhile to do things HTTP_RESPPONSE, since the first time node assigment would have happened already then, I could get the information on the server respondig and persist the assignment that has taken place. But I am not sure whether this is still "legal" to be done so late ...?
- I saw that there is a persist function which seems to be there to let the load balancer know a persistent assignment programmatically, right? Is there a way to access persisted node assignments?
Well,
if anyone would take the time to give me some first clues, if would appreciate it a lot,
Toralf Richter
- Kirk_Bauer_1018
Nimbostratus
Short answer, no problem at all -- you would use universal persistence, or perhaps just do it in an iRule (I need to go back and look). I will try to get you an example later today, but I wanted to let you know that this sort of thing is not going to be an issue at all. - torisan_93696
Nimbostratus
Hi, - Kirk_Bauer_1018
Nimbostratus
If you have any troubles let me know. As far as scoping goes, normal "local" variables are available throughout the entire connection. So if you set something in CLIENT_ACCEPTED then you can read it in LB_SELECTED and/or HTTP_REQUEST, CLIENT_CLOSED, etc.
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