# Reselct based on http response code 503

**URL:** <https://community.f5.com/t/reselct-based-on-http-response-code-503/5050>\
**Category:** Technical Forums\
**Tags:** irules, ltm, application-delivery\
**Created:** [October 14, 2018, 12:16am UTC](https://community.f5.com/t/reselct-based-on-http-response-code-503/5050 "2018-10-14T00:16:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nizlin\_109172](https://avatars.discourse-cdn.com/v4/letter/n/dc4da7/32.png) [@Nizlin\_109172](https://community.f5.com/u/Nizlin_109172)\
**Post date:** [October 14, 2018, 12:16am UTC](https://community.f5.com/t/reselct-based-on-http-response-code-503/5050/1 "2018-10-14T00:16:39Z")

</div>

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]”

```tcl
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
