tcp: add tcp_rto_max_ms sysctl

Previous patch added a TCP_RTO_MAX_MS socket option
to tune a TCP socket max RTO value.

Many setups prefer to change a per netns sysctl.

This patch adds /proc/sys/net/ipv4/tcp_rto_max_ms

Its initial value is 120000 (120 seconds).

Keep in mind that a decrease of tcp_rto_max_ms
means shorter overall timeouts, unless tcp_retries2
sysctl is increased.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Eric Dumazet
2025-02-07 15:28:30 +00:00
committed by Paolo Abeni
parent 54a378f434
commit 1280c26228
6 changed files with 29 additions and 3 deletions

View File

@@ -705,6 +705,8 @@ tcp_retries2 - INTEGER
seconds and is a lower bound for the effective timeout.
TCP will effectively time out at the first RTO which exceeds the
hypothetical timeout.
If tcp_rto_max_ms is decreased, it is recommended to also
change tcp_retries2.
RFC 1122 recommends at least 100 seconds for the timeout,
which corresponds to a value of at least 8.
@@ -1237,6 +1239,17 @@ tcp_rto_min_us - INTEGER
Default: 200000
tcp_rto_max_ms - INTEGER
Maximal TCP retransmission timeout (in ms).
Note that TCP_RTO_MAX_MS socket option has higher precedence.
When changing tcp_rto_max_ms, it is important to understand
that tcp_retries2 might need a change.
Possible Values: 1000 - 120,000
Default: 120,000
UDP variables
=============