IP::idle_timeout¶
Description¶
Returns the idle timeout value, or specifies an idle timeout value as
the criteria for selecting the pool to which you want the BIG-IP
system to send traffic.
Examples¶
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/portal" } {
IP::idle_timeout 3600
}
}
Update the idle timeout for the client and serverside connection if a condition in the HTTP_REQUEST event is true. This could be a test to see if the request was for a specific URI.¶
when HTTP_REQUEST {
if {$some_condition == 1}{
log local0. "original timeout: [IP::idle_timeout]"
IP::idle_timeout 1801
log local0. "updated timeout: [IP::idle_timeout]"
set update_serverside_idle_timeout 1
}
}
when SERVER_CONNECTED {
log local0. "original timeout: [IP::idle_timeout]"
if {[info exists update_serverside_idle_timeout] && $update_serverside_idle_timeout}{
IP::idle_timeout 1802
log local0. "updated timeout: [IP::idle_timeout]"
}
}
You can check the ltm log for the log output to see that the rule
triggered.
idle_timeout_rule <HTTP_REQUEST>: original timeout: 300
idle_timeout_rule <HTTP_REQUEST>: updated timeout: 1801
idle_timeout_rule <SERVER_CONNECTED>: original timeout: 300
idle_timeout_rule <SERVER_CONNECTED>: updated timeout: 1802
And you can check the b conn output for your client IP to see the idle
timeout.
b conn client 10.0.0.10 show all
VIRTUAL 2.2.2.2:http <-> NODE any6:any
CLIENTSIDE 10.0.0.10:4161 <-> 2.2.2.2:http
(pkts,bits) in = (2, 960), out = (1, 528)
SERVERSIDE 3.3.3.3:4409 <-> 3.3.3.4:80
(pkts,bits) in = (3, 4952), out = (4, 2440)
PROTOCOL tcp UNIT 1 IDLE 58 (1801) LASTHOP 4093 00<!--:00:00:e2:1a:2e-->
# Check the client's destination port
# Set the idle timeout based on the protocol
when CLIENT_ACCEPTED {
switch [TCP::local_port] {
20 -
21 -
22 {
# FTP, SSH: use a longer timeout
set idle 3600
IP::idle_timeout 3600
}
80 -
443 -
8080 -
8443 {
# HTTP and proxy ports: use a shorter timeout
set idle 300
IP::idle_timeout 300
}
default {
# Default port, use a middle length timeout
set idle 600
IP::idle_timeout 600
}
}
}
when SERVER_CONNECTED {
IP::idle_timeout $idle
}