Forum Discussion
Matt_Breedlove_
Nimbostratus
Apr 25, 2009Help with avoiding Reselect bug in LB_Failed
Hi All,
Running BIG-IP 9.3.1 Build 37.1
Was planning on using LB:Reselect in LB_Failed then I saw the known issue on the reference page about causing a system crash...yikes. Here is the link I am referencing
http://devcentral.f5.com/wiki/default.aspx/iRules/lb__reselect
VS has cookie insert persistence profile with 17min timeout
Also concerned even if it doesn't cause a crash on the bigip, will re-select the same failed member. The whole reason I use "LB::reselect pool" instead of just "pool" is to make sure I get a member that is up.
Here are two working versions of the rule. I am concerned about a few things:
1) Can I really not safely use LB::reselect and/or LB::mode inside of an LB_Failed event without crashing out my BigIP? What is the alternative...to only use "pool"? Doesn't using "pool" only instead of "LB::reselect pool" potentially will send a request to a member node that is actually down? Wiki page makese it sound like that
2) Are there context rules as to what commands/statements you can issue inside of events? Can I call HTTP:Redirect inside of LB events with impunity or should I only call HTTP:anything inside of CLIENT_CONNECT, HTTP_REQUEST, and HTTP_RESPONSE?
3) In the first rule I am using a pool of static html web servers for the maintenance window page...in the second it is using a redirect to an external URL with the page. Is one or the other preferred? Should I just code the maintenance window page (very simple short html page...few lines) into the irule itself using HTTP::response and avoid having to use new pools or new external URL's. Performance impact?
4) Is the various uses of "persist none" making sense below? Not necessary for HTTP:Redirect?
First rule
when CLIENT_ACCEPTED {
set lb_retrys 0
set clip [IP::client_addr]
log "Route connections to the VIP from a member node back to itself (if its the caller)
if { [LB::status pool webpool_80 member $clip 80] eq “up” } {
pool webpool_80 member $clip 80
} elseif { [active_members webpool_80] >= 4 } {
LB::mode rr
LB::reselect pool webpool_80
} else {
HTTP::uri /
persist none
pool maintpool_80
}
}
when LB_FAILED {
if { $lb_retrys < [active_members webpool_80] } {
persist none
LB::mode rr
LB::reselect pool webpool_80
} else {
HTTP::uri /
persist none
LB::mode rr
LB::reselect pool maintpool_80
}
incr lb_retrys
}
Here is the other rule that uses the redirect to an external URL, but I still was planning on using LB:reselect as I can't figure a safe way to use the LB_FAILED retry logic inside that event without using LB::reselect.
Second rule
when CLIENT_ACCEPTED {
set lb_retrys 0
set clip [IP::client_addr]
log "Route connections to the VIP from a member node back to itself (if its the caller)
if { [LB::status pool webpool_80 member $clip 80] eq “up” } {
pool webpool_80 member $clip 80
} elseif { [active_members webpool_80] >= 4 } {
LB::mode rr
LB::reselect pool webpool_80
} else {
persist none
HTTP::redirect http://maintenance_window_page
}
}
when LB_FAILED {
if { $lb_retrys < [active_members webpool_80] } {
persist none
LB::mode rr
LB::reselect pool webpool_80
} else {
persist none
HTTP::redirect http://maintenance_window_page
}
incr lb_retrys
}
Can someone help provide feedback on these issues and the irules so far?
Thanks
Matt
- Matt_Breedlove_
Nimbostratus
Any feedback on this would be appreciated. - hoolio
Cirrostratus
Hi Matt, - Matt_Breedlove_
Nimbostratus
Thanks for explaining that. Here is the modified rulewhen CLIENT_ACCEPTED { set lb_retrys 0 set maint 0 set clip [IP::client_addr] if { [LB::status pool pool_80 member $clip 80] eq “up” } { pool pool_80 member $clip 80 } elseif { [active_members pool_80] >= 4 } { LB::mode rr LB::reselect pool pool_80 } else { set maint 1 } } when HTTP_REQUEST { if { $maint = 1 } { HTTP::redirect http://maintenance_window_page } } when LB_SELECTED { if { lb_retries >= 1 } { LB::mode rr LB::reselect pool pool_80 } } when LB_FAILED { if { $lb_retrys < [active_members pool_80] } { persist none LB::mode rr LB::reselect pool pool_80 } else { HTTP::redirect http://maintenance_window_page } incr lb_retrys }
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