Forum Discussion
AppleBee_108607
Nov 02, 2010Historic F5 Account
CMP compatible strict Round Robin
Hi,
In addition to my another post, I have to urgently write an iRule to facilitate strict Round Robin event if the Virtual is CMPenabled.
I wrote code as follows but still have tw...
AppleBee_108607
Nov 02, 2010Historic F5 Account
Hi Spark,
Thanks aaa lllooott!
It's amazing how you can write these logic into this compact code.
I just made small syntax-wise modification and it worked off the shelf. I will use this at my customer. Yep, and I was also aware of the implication of read-modify-write time gap, but just didn't know how to tackle it.
Once again, thanks a lot!
----------------------------------------------------
when CLIENT_ACCEPTED {
set poolname "test-pool"
if { [active_members $poolname] < 1 } {
No active pool members; reset client
reject
return
}
set count [members $poolname]
set attempt 0
while { $attempt < $count } {
set num [table incr "round-robin:$poolname"]
set num [expr {$num % $count}]
set mbr [lindex [members -list $poolname] $num]
set mbr_ip [lindex $mbr 0]
set mbr_port [lindex $mbr 1]
if { [LB::status pool $poolname member $mbr_ip $mbr_port up] } {
pool $poolname member $mbr_ip $mbr_port
return
}
incr attempt
}
}
----------------------------------------------------
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