Forum Discussion
Wil_Schultz_101
Nimbostratus
Jul 30, 2007Reselect pool on status code 500 or above...
So we run some Tomcat servers, when we undeploy the server will send a 503 that states that the application is unavailable. I do have a check that looks for a static page every 5 seconds and fails at ...
hoolio
Cirrostratus
Oct 03, 2011That should work. The only change I can see you should make is to limit retries to GET requests. Else, you'd need to collect the HTTP payload for POSTs and append it to the request headers and then call that combined variable with HTTP::retry. That could eat up a lot of memory.
You can set a variable in HTTP_REQUEST if HTTP::method eq "GET" and then check that in your if statement looking for a 5xx status:
when HTTP_REQUEST {
if {[HTTP::method] eq "GET"}{
set request_headers [HTTP::request]
set method "GET"
} else {
set method ""
}
}
...
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "5" and $method eq "GET"} {
...
}
Also, if the retries exceeds the number of pool members, you could send back a generic HTTP 200.
Aaron
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