Forum Discussion
irule for persistent
Please help. I have a Virtual Server with 4 pool members and simply want a user to connect to the same member ie cookie persistence. Need cookie as within the application when upload is done a new session gets created which breaks it. I'm looking at a universal persistence cookie with an irule. I am advised all requests to the app have "qarpc" in it, would the below work for the irule part of an universal persistence cookie
when HTTP_REQUEST { if { [HTTP::header exists "qarpc"] } { persist uie [HTTP::header "qarpc"] } }
10 Replies
You may be interested by following commands :
persist uie [HTTP::cookie value "qarpc"]
or
persist uie [HTTP::header value "qarpc"]
BR
Yann
- mikey_webb
Cirrus
Thanks but still having an issue with the session being on the same pool member perhaps there is another way to achieve my original request?
- nitass
Employee
did you forget HTTP_RESPONSE?
sol7392: Overview of universal persistence
http://support.f5.com/kb/en-us/solutions/public/7000/300/sol7392.html Exact, Still missing the following rule to add the cookie persistence :
when HTTP_RESPONSE { if { [HTTP::cookie exists "qarpc"] } { persist add uie [HTTP::header value "qarpc"] } } when HTTP_REQUEST { if { [HTTP::cookie exists "qarpc"] } { persist uie [HTTP::header value "qarpc"] } }- mikey_webb
Cirrus
thanks for response but still having an issue with this. perhaps there is an easier way to do this? the issue again is i have an app that load balances, within the app a client can upload at this point it seems to create a new session and breaks because not on same pool member - when the client is talking to the app whether normal or upload there hhtp header will always have the value qarpc in it
- nitass
Employee
within the app a client can upload at this point it seems to create a new session and breaks because not on same pool member - when the client is talking to the app whether normal or upload there hhtp header will always have the value qarpc in it
are you using oneconnect? if not, can you try?
- mikey_webb
Cirrus
not using oneconnect and not familiar with it - but will read up if that is a solution
- mikey_webb
Cirrus
oneconnect does not seem to guarantee a client will always hit the same pool member which has to happen for this app to work - as the upload effectively creates a new session
- nitass
Employee
oneconnect does not seem to guarantee a client will always hit the same pool member which has to happen for this app to work
that could be done by persistence. there is situation that oneconnect helps when working with persistence profile.
sol7964: Persistence may fail for subsequent requests on Keep-Alive connections
http://support.f5.com/kb/en-us/solutions/public/7000/900/sol7964.html - Kevin_Davies_40
Nacreous
When does qarpc change? You need to study the logging of the qarpc cookie and see when it changes as a file transfer occurs. The F5 will always persist back to the same pool member if the cookie matches.
Logging is the key to solving your problem. You need to watch the cookie behaviour throughout a session. This will help you.
when CLIENT_ACCEPTED { set cid [expr {int (rand() * 100000)}] log local0. "\[$cid\] Connection opened." } when CLIENT_CLOSED { log local0. "\[$cid\] Connection closed." } when HTTP_REQUEST { set rid [expr {int (rand() * 100000)}] log local0. "\[$cid:$rid\] URI = [string range [HTTP::uri] 0 50]..." if {[HTTP::cookie exists qarpc]} { log local0. "\[$cid:$rid\] Cookie qarpc = [string range [HTTP::cookie qarpc] 0 50]..." } else { log local0. "\[$cid:$rid\] No Cookie qarpc Found In Request" } } when HTTP_RESPONSE { if {[HTTP::cookie exists qarpc]} { log local0. "\[$cid:$rid\] Response Cookie qarpc = [string range [HTTP::cookie qarpc] 0 50]..." } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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