Forum Discussion
Andy_Herrman_22
Nimbostratus
Jun 21, 2006Problem with persistence
I have a setup with a BIG-IP load balancer with 2 servers in a pool being load balanced. The URI that the user is connecting with contains a query parameter that is used for the persistence value. According to our logging the iRule is correctly extracting the value and setting the persistence, but requests with the same value don't always go to the same machine.
The iRule is pretty simple:
when HTTP_REQUEST {
set fulluri [HTTP::uri]
set uid [findstr [HTTP::uri] "uid=" 5 "&"]
if { $uid != "" } {
log local0. "Set persist value to uid: $uid | $fulluri"
persist uie $uid
}
else {
log local0. "No uid found in HTTP REQUEST | $fulluri"
}
}
The logging that displays always shows the correct uid value. However, I get logging on both servers showing that they've gotten requests, and those logs show the same uid. BIG-IP stats also show that it's sending requests to both servers, thought the persistence table seems correct.
Has anyone run into anything like this before? I can't find anything wrong with the iRule, and the requests are happening fast enough that the persistence values wouldn't be timing out.
14 Replies
Sort By
- Andy_Herrman_22
Nimbostratus
Ok, this is *really* weird.when HTTP_REQUEST { set fulluri [HTTP::uri] set uid [findstr [HTTP::uri] "uid=" 4 "&"] if { $uid != "" } { log local0. "Set persist value to uid: $uid | $fulluri" set currentPersist [persist lookup uie $uid node] log local0. "Current persist for $uid is $currentPersist" persist uie $uid } else { log local0. "No uid found in HTTP REQUEST | $fulluri" } }
PERSISTENT CONNECTIONS -- No persistent connections were found. Jun 22 15:31:34 : Set persist value to uid: 1 | /testapp?uid=1&sc=0 Jun 22 15:31:34 : Current persist for 1 is PERSISTENT CONNECTIONS -- Mode: universal Value: 1 Virtual: 10.10.70.171:http Node: 10.10.70.32:http Age: 2sec Jun 22 15:31:41 : Set persist value to uid: 1 | /testapp?uid=1&sc=0 Jun 22 15:31:41 : Current persist for 1 is 10.10.70.32 PERSISTENT CONNECTIONS -- Mode: universal Value: 1 Virtual: 10.10.70.171:http Node: 10.10.70.32:http Age: 5sec Jun 22 15:31:50 : Set persist value to uid: 1 | /testapp?uid=1&sc=0 Jun 22 15:31:50 : Current persist for 1 is 10.10.70.32 PERSISTENT CONNECTIONS -- Mode: universal Value: 1 Virtual: 10.10.70.171:http Node: 10.10.70.32:http Age: 1sec Jun 22 15:32:03 : Set persist value to uid: 432 | /testapp?uid=432&sc=0 Jun 22 15:32:03 : Current persist for 432 is PERSISTENT CONNECTIONS -- Mode: universal Value: 1 Virtual: 10.10.70.171:http Node: 10.10.70.32:http Age: 15sec Jun 22 15:32:10 : Set persist value to uid: 432 | /testapp?uid=432&sc=0 Jun 22 15:32:10 : Current persist for 432 is PERSISTENT CONNECTIONS -- Mode: universal Value: 1 Virtual: 10.10.70.171:http Node: 10.10.70.32:http Age: 9sec Jun 22 15:32:17 : Set persist value to uid: 432 | /testapp?uid=432&sc=0 Jun 22 15:32:17 : Current persist for 432 is PERSISTENT CONNECTIONS -- Mode: universal Value: 1 Virtual: 10.10.70.171:http Node: 10.10.70.32:http Age: 2sec Jun 22 15:32:28 : Set persist value to uid: 321 | /testapp?uid=321&sc=0 Jun 22 15:32:28 : Current persist for 321 is PERSISTENT CONNECTIONS -- Mode: universal Value: 1 Virtual: 10.10.70.171:http Node: 10.10.70.32:http Age: 14sec Jun 22 15:32:34 : Set persist value to uid: 321 | /testapp?uid=321&sc=0 Jun 22 15:32:34 : Current persist for 321 is PERSISTENT CONNECTIONS -- Mode: universal Value: 1 Virtual: 10.10.70.171:http Node: 10.10.70.32:http Age: 7sec Jun 22 15:35:38 : Set persist value to uid: 90 | /testapp?uid=90&sc=0 Jun 22 15:35:38 : Current persist for 90 is PERSISTENT CONNECTIONS -- Mode: universal Value: 90 Virtual: 10.10.70.171:http Node: 10.10.70.39:http Age: 3sec
- unRuleY_95363Historic F5 AccountSheesh, I go on vacation one day and no one can seem to answer this for you...
- Andy_Herrman_22
Nimbostratus
Oops, minor bug.set persistVal "NOUID"
- Michael_Voight_Historic F5 Account
I am unclear why you would sent the persist value to NOID or STATICREQ and then persist using those values. If there is no UID presented, why would you create or use a persistence record for that request?
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