Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

client request rule

suthomas1
Cirrostratus
Cirrostratus

Good day all,

 

We have recently taken over a subsidary of ours and f5 is one of their devices.

In a virtual service, this irule is found. I am trying to understand what this does with the virtual server traffic.

 

Please help me to understand what this is used for. The service is an https that converts the client requests to another port on the pool member.

( some of these have been slightly changed here for discreet purpose)

 

 

when CLIENT_ACCEPTS {

  set retry 0

}

 

when HTTP_REQUEST {

  set http_request [HTTP::request]

}

 

when HTTP_RESPONSE {

  if { ([HTTP::status] starts_with "4")} {

    incr retry

    if { $retry <= [active_members [LoB::pool]] } {

      HTTP::retry $http_request

    } else {

      set retry 0

    }  

 

  } else {

    set retry 0

  }

}

 

when ltm-pass {

  if { ($retry > 0) && ($retry <= [active_members [LoB::pool]])} {

    LB::reselect pool [LoB::pool]

      log local0.info "New LB server is [LoB::xyz]"

  }

}

 

when ltm-fail {

if { $retry <= [active_members [LoB::pool]]} {

incr retry   

LoB::reselect pool [LoB::pool]

}   

}

 

1 ACCEPTED SOLUTION

Andrew-F5
F5 Employee
F5 Employee

The very short summary: this iRule will (1) force an HTTP request to be resent if it initially receives a 4xx level response from the server (2) log the pool member that is selected after the first request fails and it retries (3) try selecting a new pool member if the first one fails.

 

LB::reselect

HTTP::retry

 

View solution in original post

1 REPLY 1

Andrew-F5
F5 Employee
F5 Employee

The very short summary: this iRule will (1) force an HTTP request to be resent if it initially receives a 4xx level response from the server (2) log the pool member that is selected after the first request fails and it retries (3) try selecting a new pool member if the first one fails.

 

LB::reselect

HTTP::retry