Tru64 Unix
1753962 會員
7646 線上
108811 解決方案
發表新文章

如何得tcpip timeout 設定時間

 
watermelonyu
教授

如何得tcpip timeout 設定時間

我想知道TCPIP timeout 設定時間,是在sysconfig中哪一個參數呢?
1則回覆 1
watermelonyu
教授

如何得tcpip timeout 設定時間

Hi,



Please see "# man sys_attrs_inet".

..

tcp_msl

The maximum lifetime of a TCP segment.



Default value: 60 (in units of .5 seconds)



Minimum value: 1



Maximum value: 2 billion

..



And



CLOSE_WAIT state uses keepalive timer

-------------------------------------

A socket reaches a CLOSE_WAIT state during a passive close condition.

This happens when the client doesn't properly close the connection. The

client has sent a FIN, the server responds with an ACK, and sits waiting

for a close() system call from the client application to close the

socket.



If the client application has setup a keepalive timer on the socket,

these will go away at the time specified in the client application. If

the client has not set the timer, the server can enable keepalives to

handle this condition. Following are the parameters used for this timer,

and their default values. They are all in the "inet" subsystem in

sysconfigtab.



tcp_keepalive_default = 0 (set to 1 to enable)

tcp_keepcnt = 8 (number of retransmitted probes to client)

tcp_keepidle = 14400 (half-seconds = 2 hours) (length of time before

first probe is sent. this is the parameter to change if you want to

lower the time the sockets hang around in this state)

tcp_keepintvl = 150 (half-seconds = 1.25 min) (time between probes)



So the total time before a CLOSE_WAIT socket connection is dropped is,

by default -



tcp_keepidle + ( tcp_keepcnt * tcp_keepintvl) =

2 hours + ( 8 * 1.25 mins ) =

2 hours 10 minutes



You can change these parameters dynamically, as follows, but they will

not affect current sockets in this state, only future connections.



# sysconfig -r inet tcp_keepalive_default=1

tcp_keepalive_default: reconfigured



To change the parameters permanently, add the lines to the

/etc/sysconfigtab, with

the following format.



inet:

tcp_keepalive_default=1

tcp_keepidle = 7200



Best regards,

Richard.