Forum Discussion
Rajesh_A_142089
Nimbostratus
Jul 01, 2014iRule HTTP_RESPONSE event not kicking in
Here is my scenario:
IIS Server IIS Site (Serves my site) an iRule on the aboe IIS Site Virtual Server The iRule has following events: HTTP_INIT, HTTP_REQUEST, HTTP_RESPONSE
When the ...
Kevin_Stewart
Employee
Jul 03, 2014While it's certainly a workable idea, I'd hesitate to use the after command, given that it has the potential to consume extra memory and that you'd be using it on every HTTP response. I think you might do well here with an inband monitor and an iRule like this:
when CLIENT_ACCEPTED {
set def_pool [LB::server pool]
set lb_fails 0
}
when LB_FAILED {
log local0. "lb failed"
if { $lb_fails < [active_members $def_pool] } {
LB::mode rr
LB::reselect pool $def_pool
} else {
log local0. "no servers available"
HTTP::redirect "http://www.google.com"
}
incr lb_fails
}
You'd normally combine this with an active monitor that proactively removes failed members from the pool, while the inband monitor and iRule waits some predetermined amount of time for a response before triggering an LB_FAILED event.
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