gpt4 book ai didi

tcp - 为什么 HAProxy 建议将超时设置为 3 秒的倍数?

转载 作者:可可西里 更新时间:2023-11-01 02:49:23 25 4
gpt4 key购买 nike

来自HAProxy documentation on client timeouts :

It is a good practice to cover one or several TCP packet losses by specifying timeouts that are slightly above multiples of 3 seconds (eg: 4 or 5 seconds).

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

最佳答案

这似乎是默认的 TCP 重传超时。来自 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.

关于tcp - 为什么 HAProxy 建议将超时设置为 3 秒的倍数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16026277/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com