Forum Discussion
Chris_Miller
Altostratus
Apr 26, 2010Best Way to do Cookie Persistence here?
I have one VIP and 5 "pools" that can service the VIP. Each pool is made up of 3 clustered servers so pool persistence is required, but not server persistence within the pool.
So, if a user hits our site, their first request should be sent via least connection load balancing to a pool. I planned on creating datagroups with the IPs of each pool and based on that, setting a cookie. So, if the user got load balanced to pool 1 which was served by 1.1.1.1-1.1.1.3, I'd create a datagroup for that ip range and would send a cookie in the response for pool 1. When traffic returned, I'd check that the cookies existed and send to the corresponding pod.
So, 1 VIP, 1 iRule, 5 Pools, 3 servers per pool...what's the best way with an iRule to do this?
- Michael_Yates
Nimbostratus
You could seperate the traffic to each pool of servers based on the content type or by the request in the URI: - The_Bhattman
Nimbostratus
An alternate iRule you can use the switch commandwhen HTTP_REQUEST { switch -glob [string tolower[HTTP::uri]] { "/content1*" { pool pool.for.content1 } "/content2*" { pool pool.for.content2 } "/content3*" { pool pool.for.content3 } "/content4*" { pool pool.for.content4 } "/content5*" { pool pool.for.content5 } default { HTTP::redirect http://[getfield [HTTP::host] ":" 1]/content1 } } }
- Chris_Miller
Altostratus
The content on all the "pools" is the same. I misspoke above about the first request. - Chris_Miller
Altostratus
Removed - Michael_Yates
Nimbostratus
I believe that you are trying to replace the default behavior of the F5 Persistence Cookie and compensate for Pool Member failures with an iRule. You shouldn't have to do either since those features are available through Virtual Server and Pool setup options. - Chris_Miller
Altostratus
Posted By Michael Yates on 04/27/2010 08:14 AM - hoolio
Cirrostratus
I haven't read through and fully understood the example you provided, but I can see at least one issue with the overall scenario. I don't think you'll be able to use LTM's least connections load balancing algorithm, as it sounds like you want to logically combine the connection counts for clusters of three servers. - Chris_Miller
Altostratus
Posted By hoolio on 04/28/2010 09:52 AM
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