How to disable TCP slow start in Linux?
Asked Answered
I

1

14

I am looking for disable TCP slow start mechanism for high-speed network. Currently clients send 100MB flows to random servers with non-blocking 1Gbps link. In my math, the completion time of the flows is less than 1 second.

But the problem is that they cannot reach to a full link bandwidth. In other words, they are finished at slow start phase before getting a full link bandwidth.
Therefore, I want to increase TCP congestion window size to maximum.

Is there anyone who know how to change that value easily without modification the kernel?

Imputation answered 10/6, 2013 at 0:48 Comment(1)
More probably what you really want is to increase the socket receive buffer size at the receiver to at least the bandwidth-delay productUndersheriff
S
15

On Linux platforms the SSR setting can be checked and disabled via the following commands:

$> sysctl net.ipv4.tcp_slow_start_after_idle
$> sysctl -w net.ipv4.tcp_slow_start_after_idle=0

Slow start is also used after a connection has been idle, unless this behavior is disabled in

/proc/sys/net/ipv4/tcp_slow_start_after_idle.
Subtractive answered 10/6, 2013 at 6:37 Comment(5)
Can I set congestion window to maximum by like these? "sudo ip route change default via X.X.X.X dev ethN initcwnd 100" and "sudo ip route change default via X.X.X.X dev ethN initrwnd 100"Imputation
Yes you can set like these. Please refer to cdnplanet.com/blog/tune-tcp-initcwnd-for-optimum-performanceSubtractive
If you want it to stick (e.g. after reboot), add net.ipv4.tcp_slow_start_after_idle=0 to /etc/sysctl.conf.Amative
Note for those finding this answer that the question asks about TCP slow start, but this answer is about "slow start restart" which occurs after an existing socket becomes idle. This might confuse some people because this answer does not change the initial congestion window for a new connection which is governed by RFC 5681 §3.1 that requires an initcwnd based on the maximum segment size. What often helps for connections with long RTT is a cwnd resize algorithm that better resizes cwnd such as hybla (controlled with net.ipv4.tcp_congestion_control), and increasing receive buffers.Christly
When I have multiple interfaces, is it possible to disable slow start after idle for specific interface only? I think the feature makes lots of sense for connections over internet but for local connections it should be disabled.Regnant

© 2022 - 2024 — McMap. All rights reserved.