Forum Discussion

Nizlin_109172's avatar
Nizlin_109172
Icon for Nimbostratus rankNimbostratus
Oct 14, 2018

Reselct based on http response code 503

Below is the irule I am using

when CLIENT_ACCEPTED { set retries 0 set default_pool pool-name }

when HTTP_REQUEST { if { [HTTP::method] eq "GET" && $retries == 0 }{ set request_headers [HTTP::request]

log local0. "Saving HTTP request headers: $request_headers"

} } when LB_SELECTED { if { $retries > 0 } { LB::reselect pool $default_pool } } when HTTP_RESPONSE { if { [HTTP::status] starts_with "503" } {

log local0. "503 error caught: retry $retries out of [active_members $default_pool]"
  if { $retries < [active_members $default_pool] } {
     HTTP::retry $request_headers
     return
  }

} set retries 0 }

Below are the things I noticed.

Client side is hung with no responses. F5 is not giving the request to other working members which doesn’t have a 503. So we can alter the irule to send to other members in the next retry itself instead of sending to existing node. We are having a VIP with FQDN nodes with IP based persistence

No RepliesBe the first to reply