cancel
Showing results for 
Search instead for 
Did you mean: 

iRule to set tcp timeout value for the specific URL

Nik2607
Nimbostratus
Nimbostratus

Hello Team,

We have a requirement to set up an iRule to set the TCP timeout of 600 sec for a particular URL passing via F5 VIP. I took some help from the F5 Dev articles, here is the complete iRule -

 

when HTTP_REQUEST {

if { ([HTTP::host] equals "example.com") } {

  IP::idle_timeout 600

set serverside_idle_timeout 1

 } 

}

 

when SERVER_CONNECTED {

 

if {$serverside_idle_timeout} {

 

IP::idle_timeout 600

 }

}

 

is this correct? Could someone tell explain why we need "set serverside_idle_timeout 1"

6 REPLIES 6

Hi ,

 

see this documentation: Clouddocs > > IP::idle_timeout 

The variable is set in HTTP_REQUEST, if the variable $serverside_idle_timeout is 1 also the idle timeout on the server-side will be set to 600.

 

KR

Daniel

Hi  To expand on Daniel's reply, the example iRule in the Clouddocs site includes some more logic to help weed out edge cases, and to answer your question about "why we need "set serverside_idle_timeout 1"", that is because the details from HTTP::host don't exist inside of the SERVER_CONNECTED event without being transferred through a variable.

Erm, yes. I actually skipped to answer the question of "why". Thanks for closing this gap.

Hello Experts,

The given iRule did not work and caused service interruptions. I have changed the syntax as below that resolved the issue - 

serverside_idle_timeout 1 replaced with update_serverside_idle_timeout 1

{$serverside_idle_timeout} replaced with {[info exists update_serverside_idle_timeout] && $update_serverside_idle_timeout}

can someone explain me please what is the exact difference in the old and new syntax?

Hello Experts,

The given iRule did not work and caused service interruptions. I have changed the syntax as below that resolved the issue - 

serverside_idle_timeout 1 replaced with update_serverside_idle_timeout 1

{$serverside_idle_timeout} replaced with {[info exists update_serverside_idle_timeout] && $update_serverside_idle_timeout}

can someone explain me please what is the exact difference in the old and new syntax?