Forum Discussion
irule: load balance connections for diff pools
I suppose semantically speaking the following would work:
when CLIENT_ACCEPTED {
switch [expr {int(rand()*2)}] {
0 {
if { [active_members POOL-A] > 0 } {
pool POOL-A
} else {
pool POOL-C
}
}
1 {
if { [active_members POOL-B] > 0 } {
pool POOL-B
} else {
pool POOL-D
}
}
}
}
But of course this doesn't deal with any sort of persistence, and certainly would break any persistence method applied to the VIP without some additional logic. Given that you want to basically spread the load across all of the members of pools A and B and only use pools C and D if either of the other two fail, what about putting all of the servers into a single pool, and then setting A and B members to a higher priority activation group. This would evenly distribute the load across A and B members and only use C an D members if some priority activation threshold was met.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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