Forum Discussion
Frank_Mancini_3
Nimbostratus
Mar 11, 2008Irule that waits?
Is it possible to write an iRule that has a wait time of 25 seconds before proceeding to the next step?
Chris_14455
Nimbostratus
Mar 25, 2008Yea our problem is one of timing. In the CLIENT_DATA we parse the request for a token. We use that token to lookup the node we should load balance the request to. However, if there is no mapping at that point we would like to load balance the request to the least used server. All subsequent requests with the same TOKEN would then get sent to the same node.
Note in this case the token is shared by multiple users and the request only occurs on connect. Connections are long lived like an SSH/Telnet session.
Now as it stands today we do the select in CLIENT_DATA if there is one defined already. If not we attempt to load balance it at which point we set it after it is known. The timing issue comes as a result of the separation of get/set. Unless we do both the get and the set in the same event we will run into concurrency issues correct?
Our current train of thought would be to check the session table when we attempt to set the value. If it is still null at the point we are attempting to write to it everything is good. However, if its not null then we know we had a concurret connect and its the second one that needs to be adjusted. Obviously the problem with this is that we are already connected so the only way we could adjust the connection is by breaking one side of the link or both. Thats doable but not desireable.
Now you suggest we look at the LB_SELECTED. I suppose we could do the same thing there. Aka set the value (assuming its available of course) if and only if the session table is still null. If it is not null then override the selected node with the one from the table? Once that was complete the connection process continues with that new node?
Of course it gets more complicated. If the connection fails we clear the record and restart. Aka our session table lives for as long as the node is up. Its down state is detected by a failure to connect. Assuming we have no false positives there I suppose we could make that work too.
Ideas/suggestions?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
