Forum Discussion
Ian_Stewart_390
Nimbostratus
Oct 14, 2005iRules, URL Routing and Cookie Persistance
Hi Everyone,
We have a BigIP 1500, configured with several virtual servers and pools. We use an iRule to make routing decisions to direct traffic to the correct pool based on request URL, since the site is distributed across several pools.
The iRule for one of the virtual servers is as follows. It has a default pool of webnode3_pool.
when CLIENT_ACCEPTED {
set defpool [LB::server pool]
}
when HTTP_REQUEST {
set request_uri [string tolower [HTTP::uri]]
set request_host [string tolower [HTTP::host]]
if { $request_uri contains "/aspnet_client/" } {
pool webnode_pool
}
elseif { $request_uri contains "/ig_common/" } {
pool webnode_pool
}
elseif { $request_uri contains "/cpm/" } {
pool cpmweb_pool
}
elseif { $request_uri contains "/agentrequest/" } {
pool webnode_pool
}
elseif { $request_uri contains "/agents/" } {
pool webnode_pool
}
elseif { $request_uri contains "/home/" } {
pool webnode_pool
}
else {
pool $defpool
}
}
The URL routing works fine. The virtual server is configured to use cookie-insert persistance. If I look at my cookies when I browse the site, I can see BigIP cookies. My concern is that in the administration webpage, under persistance records, every record is showing SOURCE ADDRESS AFFINITY. We recently tried to run a load balancing test, (one machine that makes multiple connections to the site to generate a load), and the BigIP failed to load balance any of the requests.
Does using the iRule not allow the default persistance method defined on the virtual server to take effect? Is there something else I'm missing here -- why isn't cookie-insert persistance working?
Thanks in advance,
Ian
22 Replies
Sort By
- Brian_Gupta_115
Nimbostratus
Could you please post the configuration for this virtual? - Ian_Stewart_390
Nimbostratus
Gladly. - JRahm
Admin
I don't think the LB::server is available in the CLIENT_ACCEPTED event, so nothing is getting set, and thus, no default persistence. - Ian_Stewart_390
Nimbostratus
To test your idea, I put a log line just after the set defpool command. - Brian_Gupta_115
Nimbostratus
If this is in testing, can you remove the fallback persistence profile? (Source IP) - Ian_Stewart_390
Nimbostratus
I can't remove the fallback persistance profile right now -- this is a production enviornment. Possibly I could do it late tonight -- what were you looking to see? If it would stop persisting at all after that was turned off? - Brian_Gupta_115
Nimbostratus
Right. I've never used a fallback persistence profile, and I wanted to take it out of the equation. - Brian_Gupta_115
Nimbostratus
One other thing, I think you need the following in your persistence profile... "cookie mode insert" - Ian_Stewart_390
Nimbostratus
cookie mode insert is in the parent profile "cookie", and I shouldn't have to respecify it. No harm in doing so though, so I've done that. I have not seen any change yet though. =/ - Brian_Gupta_115
Nimbostratus
What does "across services enable" do, and why do you have it set?
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