Description
Specifies the time that must elapse before TCP can release a closed connection and reuse its resources. This interval between closure and release is known as the TIME_WAIT state or 2MSL state. During this time, the connection can be reopened at much less cost to the client and server than establishing a new connection.
RFC 793 requires that TCP maintains a closed connection for an interval at least equal to twice the maximum segment lifetime (2MSL) of the network. When a connection is released, its socket pair and TCP control block can be used to support another connection. By default, the maximum segment lifetime is defined to be 120 seconds, and the value of this entry is equal twice that, or 4 minutes. However, you can use this entry to customize the interval.
Reducing the value of this entry allows TCP to release closed connections faster, providing more resources for new connections. However, if the value is too low, then TCP might release connection resources before the connection is complete, requiring the server to use additional resources to reestablish the connection.
出處:http://technet.microsoft.com/en-us/library/cc757512%28WS.10%29.aspx
根據上述的說明,TIME_WAIT值是在TCP connection關閉後,要經過多少時間,TCP才會真的釋出這個 connection,以及這個connection所用到的資源。這個設計的好處是,如果在TIME_WAIT時間內,要重新使用已關掉的connection,只要在TCP釋出它的資源之前,不需重新建立,而可以直接re-open該connection。一般來說,TIME_WAIT的值會是 2倍的 Maximum Segment Lifetime的時間。
沒有留言:
張貼留言