Forum Discussion
Jeff_43264
May 19, 2010Nimbostratus
Hash persistence based on true-client-IP
Greetings all,
I'm working on my first iRule, because of a unique requirement I have. I am setting up load balancing for a web-based application that is very sensitive to view state, and so...
hooleylist
May 19, 2010Cirrostratus
Hi Jeff,
The two lindex commands are parsing the pool member IP and port from the active_members list. As you're not actually using persistence with this, you shouldn't need to add a persistence profile to the VIP. The load balancing algorithm will also be ignored as you're using the iRule to select the pool member based on the client IP address that Akamai reports the request came from.
Also, you could make that rule just a little more efficient by eliminating the intermediate variable $picked. You can also add logic to handle the pool being down or the scan command failing to parse the IP and port output:
Check if the active_members command returns an entry which can be split on a space into two variables
if {[active_members app_http_pool]}{
if {[scan [lindex [active_members –list app_http_pool] [expr {[md5 $tcip_header] % [active_members app_http_pool]}]] {%s %s} ip port] == 2}{
Select the pool member IP and port
pool app_http_pool member $ip $port
Exit from this event in this rule
return
}
Take some default action if the pool is down or scan didn't parse the output?
}
Aaron
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