Forum Discussion
ta11ey_89826
Nimbostratus
Oct 30, 2008Need Cookie Hash iRule Help
I have an iRule performing a cookie hash that is working... for the most part.
The pool 'amtrial_http' contains the two nodes referenced in the iRule. Obviously, when the 1st request comes into the virtual server, it does not have a cookie so it is sent to the 'amtrial_http' pool - and I can confirm this in the ltm log...
Oct 29 18:10:22 tmm tmm[2134]: Rule iamlbcookie_http : default
My issue is that when a request matches this rule, the request is always sent to one server. There is no load balancing and I would have thought that when the request is sent to the pool 'amtrial_http', then the request takes on the load balancing methodology of the pool. I have changed my 'Load Balancing Method' from Least Connections to Round Robin, to Ratio... I've tried just about all of them with no success. Is there some load balancing logic that I need in the iRule for the pool? Please help.
when HTTP_REQUEST {
if { [HTTP::cookie exists "iamlbcookie"] } {
log local0. "[HTTP::cookie "iamlbcookie"]"
switch [HTTP::cookie "iamlbcookie"] {
*01* {
node 192.168.1.1
log local0. "matched 01"
}
*02* {
node 192.168.1.2
log local0. "matched 02"
}
}
}
else {
pool amtrial_http
log local0. "default"
}
}
- Colin_Walker_12Historic F5 AccountWhen using the pool command to direct traffic to a particular pool in your config it should absolutely take on the load balancing method that's applied to that pool. Is there perhaps persistence set up? If not, could you send us the pool config snippet as well to take a look?
- ta11ey_89826
Nimbostratus
I'm using the iRule in the cookie hash persistence profile. - ta11ey_89826
Nimbostratus
Thanks for looking, btw. - Colin_Walker_12Historic F5 AccountPicking this one back up - Have you been able to confirm via log statements in the iRUle that the other matches are actually being met via the traffic and the iRule is firing the commands inside of those switch cases?
- ta11ey_89826
Nimbostratus
Yes I have, here's some log entries... - ta11ey_89826
Nimbostratus
As an FYI, I have recreated the issue in our dev environment. I am using the same iRule and seeing the same results. I listed the wrong pool info above... here's the http pool info for the current dev environment... - Colin_Walker_12Historic F5 AccountI'm not sure I'm following the problem. You say that things aren't being load-balanced when sent to the AccessManager Pool, but I'm not sure how you're measuring that. All you're showing is the traffic to the two pool members, and both members are receiving traffic.
- ta11ey_89826
Nimbostratus
"Where is it that you're seeing traffic not load-balancing?" I'm watching my pool statistics under Local Traffic / Pools / Statistics. All of the traffic is directed to node 192.168.72.38. - c_p_i_o_17707Historic F5 AccountIn case of "least connections" algorithm, (as you had first selected) it is possible that the BIG-IP will pick the same member over and over again if all pool members have the same number of connections.
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