Forum Discussion

ibehavior_37902's avatar
ibehavior_37902
Icon for Nimbostratus rankNimbostratus
Aug 20, 2010

iRule to drop connection after xxxx miliseconds

Hi -

 

 

I am looking for a way to drop a connection if a response has not been received from a back end server in 1000 milliseconds. I have an iRule that logges reponse time and would like to just modify to drop the connection if if the response time exceeds 1000 ms.

 

 

Any help would be appreciated.

 

 

Thanks

 

 

Current iRule:

 

when HTTP_REQUEST {

 

Get time for start of HTTP request

 

set http_request_time [clock clicks -milliseconds]

 

HTTP::collect 4096

 

Log the start of a new HTTP request

 

set LogString "[IP::client_addr] [HTTP::host] [HTTP::method] [HTTP::uri]"

 

log 192.168.50.17 local0.info "$LogString"

 

log local0.info "$LogString"

 

}

 

 

when HTTP_RESPONSE {

 

Received the response headers from the server. Log the pool name, IP and port, status and time delta

 

log 192.168.50.17 local0.info "$LogString [HTTP::status] pool_info: [LB::server] (ResponseTime: [expr [clock clicks -milliseconds] - $http_request_time] ms)"

 

log local0.info "$LogString [HTTP::status] pool_info: [LB::server] (ResponseTime: [expr [clock clicks -milliseconds] - $http_request_time]ms)"

 

}

 

1 Reply

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Have you looked into the after command? If you're on 10.x the after command could help you do exactly what you're looking for, I think. Take a look: Click Here

     

     

    Colin