Forum Discussion
Matt_Breedlove_
Nimbostratus
Apr 18, 2009Feedback on multi-pool irule
Please provide some feed back on this irule which is mean to relativley evenly distribute inbound traffic thgrough a single VS across 2 pools of servers depending on which pool has more active members compared to the other. If both pools have 0 active members or LB_Failed then the connection is sent to a third apology page pool.
Long term vision is to scale this up to several pools of servers. Each pool contains groups of servers with specific horsepower quotients.
By using good ecv monitor we expect this irule should auto adjust connection load across pools based on strength of pool health by looking at active members.
There are two "HTTP_REQUEST" blocks below. Which is more efficient?
Should a switch statement be used? This will be used on a very busy site which is why I wanted to stear clear of anything intensive like regex or enc/dec stuff
Is there a better method to do this?
when LB_FAILED {
pool pool_sorry
}
when HTTP_REQUEST {
if { [active_members pool_a] > [active_members pool_b] } {
if { [active_members pool_a] = 0 } {
pool pool_sorry
} else {
pool pool_a
}
} else {
if { [active_members pool_b] = 0 } {
pool pool_sorry
} else {
pool pool_b
}
}
}
when HTTP_REQUEST {
if { [active_members pool_a] > [active_members pool_b] } {
pool pool_a
} else {
pool pool_b
}
}
- Matt_Breedlove_
Nimbostratus
Posted By mattbreedlove on 04/17/2009 11:41 PM
when HTTP_REQUEST { if { [active_members pool_a] > [active_members pool_b] } { if { [active_members pool_a] = 0 } { pool pool_sorry } else { pool pool_a } } else { if { [active_members pool_b] = 0 } { pool pool_sorry } else { pool pool_b } } } when LB_FAILED { pool pool_sorry }
when HTTP_REQUEST { if { [active_members pool_a] > [active_members pool_b] } { pool pool_a } else { pool pool_b } } when LB_FAILED { pool pool_sorry }
- hoolio
Cirrostratus
In a quick test with a VIP pointing to a pool with no active members, LB_FAILED is triggered immediately. If you take the monitor off the pool, LB_FAILED isn't triggered immediately. See the LB_FAILED wiki page for details on this (Click here).
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