Forum Discussion
roykidder
Nimbostratus
Aug 05, 2016Respond with 5xx message when pool members connection limits reached (iRule?)
I have a use case where I have a pool of web server appliances that, when over loaded, simply time out. I want to set a connection limit on a per-member basis and then be able to hand back a 5xx to t...
Kai_Wilke
MVP
Aug 07, 2016Hi Roy,
if the connection limit of a pool member has been exhausted, the pool member will become temporary marked down, so that it does not receive any new connections attemps. During this time
[active_members] do not count nor list the pool member which connection limit is exhausted.
You may try the iRule below. It performs a transparent
LB::reselect in the case a pool member has just become unresponsive (but still marked as online) and also displays a [HTTP::response 503] in the case, that all remaining pool members are offline (or having their connection limits exhausted).
when LB_FAILED {
if { not [info exists "reselect_count"] } then {
set reselect_count 0
}
if { [active_members [LB::server pool]] > $reselect_count } then {
LB::mode rr
LB::reselect
incr reselect_count
} else {
HTTP::respond 503 content "The application is too busy to serve your requests..."
set reselect_count 0
}
}
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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