Forum Discussion
AndrewM_4835
Nimbostratus
Jun 11, 2008Hash Load Balancing
Dear Forum,
I am looking at trying an iRule to persistently load balance a group of web servers.
I have found an article 'Hash Load Balancing and Persistence on BIG-IP LT...
AndrewM_4835
Nimbostratus
Jun 25, 2008Modified version with error checking
when HTTP_REQUEST
{
set search_server_list { {10.0.164.11 20001}
{10.0.164.11 20002}
{10.0.164.11 20003}
}
set active_server_list {}
foreach node_address $search_server_list
{
if { [LB::status pool search_hash_pool member [lindex $node_address 0] [lindex $node_address 1]] eq "up" }
{
lappend active_server_list $node_address
}
}
if {[catch {set server_number [expr {[findstr [HTTP::uri] "SRV=" 4 2]} % {[llength $active_server_list]}] }]}
{
pool search_hash_pool
}
else
{
set picked [ lindex $active_server_list $server_number ]
pool search_hash_pool member [lindex $picked 0] [lindex $picked 1]
}
}
Now all that remains is to test the performance.
Thanks all for your help.
Regards
Andrew
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