1

关于客户端超时的 HAProxy 文档中

通过指定略高于 3 秒的倍数(例如:4 或 5 秒)的超时来覆盖一个或多个 TCP 数据包丢失是一种很好的做法。

这似乎是一个任意数字。3秒的数字有什么意义?

4

1 回答 1

2

It appears this is the default TCP retransmission timeout. From this Microsoft KB article:

TCP starts a re-transmission timer when each outbound segment is handed down to IP. If no acknowledgment has been received for the data in a given segment before the timer expires, then the segment is retransmitted, up to the TcpMaxDataRetransmissions times. The default value for this parameter is 5.

The re-transmission timer is initialized to 3 seconds when a TCP connection is established; however it is adjusted "on the fly" to match the characteristics of the connection using Smoothed Round Trip Time (SRTT) calculations as described in RFC793. The timer for a given segment is doubled after each re-transmission of that segment. Using this algorithm, TCP tunes itself to the "normal" delay of a connection. TCP connections over high-delay links will take much longer to time out than those over low- delay links.

于 2013-04-16T00:19:00.770 回答