Forum Discussion
Help with URI string-based session persistence
- Jun 11, 2015
If this happens the LB just sends the request to the same node that the TCP session is tied to - but the iRule still logs as seeing the new strID value. I was confused and expected this to create a new persistence record and load balance the request, but something tells me I would need more logic in my iRule to detach the connection and re-load balance it with a new persistence record.
you can use oneconnect profile. it will do that for you.
Since I am newer to F5 I have been using the f5.http iApp template for setup of the testing. I set the OneConnect setting to "Do not use OneConnect" so I am not as far as I can tell. If you want, I could paste my configuration here for you as well.
I can see the key in the logs as you've indicated, and I also receive the same - here are the logs when using two different strID from the same IP & browser session (just changing the value and sending another request, did this many times in a row and the node never changed):
Jun 8 10:25:16 test info tmm[11258]: Rule /Common/URI_LB_Tomcat <HTTP_RESPONSE>: URI: /some_uri?&strID=acb20311211&strTimeLimitInSecs=180&request=poll key: acb20311211 server: 10.64.115.151:80
Jun 8 10:25:30 test info tmm[11258]: Rule /Common/URI_LB_Tomcat <HTTP_RESPONSE>: URI: /some_uri?&strID=acb211&strTimeLimitInSecs=180&request=poll key: acb211 server: 10.64.115.151:80
`</pre>
When I do the "show ltm persistence persist-records" command, I still receive just one record for the output. I guess I would of expected to see two entries, despite the fact the source browser session and IP are from the same - but because the strID is different, it would instead create a new entry for the new key.
-- From further testing --
I notice that when I send in different strID values from different source IPs it creates a new record - which is more what I would expect whenever the strID value changes.
If I send in the same strID value from two different source IP addresses, it doesn't use the existing record of the first request and instead seems to load balance to a different node - as seen by these logs where I used the same URI from two machines:
Jun 8 10:45:03 test info tmm1[11258]: Rule /Common/URI_LB_Tomcat <HTTP_RESPONSE>: URI: /some_uri?&strID=acb211211&strTimeLimitInSecs=180&request=poll key: acb211211 server: 10.64.115.151:80
Jun 8 10:45:23 test info tmm[11258]: Rule /Common/URI_LB_Tomcat <HTTP_RESPONSE>: URI: /some_uri?&strID=acb211211&strTimeLimitInSecs=180&request=poll key: acb211211 server: 10.64.115.150:80
The node IP is different, which isn't what I would of expected. I would expect that the user's request would be directed to the same node to be processed since the strID value matches.
I feel that maybe I am misunderstanding something fundamental on universal persistence and its functionality, but I can't put my finger on it. Thank you again for all of your help!
Edit: sorry for the messed up ampersands etc in the logs - it seems the "edit" functionality on the forum here can blow up my original post!
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