[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKe=GCvSp1u5=6F+NYNUoGeOLyp0-ce8_Y-z8Vo=6-xMA@mail.gmail.com>
Date: Tue, 9 Apr 2024 09:12:57 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Hechao Li <hli@...flix.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Soheil Hassas Yeganeh <soheil@...gle.com>, netdev@...r.kernel.org,
Tycho Andersen <tycho@...ho.pizza>
Subject: Re: [PATCH net-next v2] tcp: increase the default TCP scaling ratio
On Tue, Apr 9, 2024 at 1:32 AM Hechao Li <hli@...flix.com> wrote:
>
> After commit dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale"),
> we noticed an application-level timeout due to reduced throughput.
>
> Before the commit, for a client that sets SO_RCVBUF to 65k, it takes
> around 22 seconds to transfer 10M data. After the commit, it takes 40
> seconds. Because our application has a 30-second timeout, this
> regression broke the application.
>
> The reason that it takes longer to transfer data is that
> tp->scaling_ratio is initialized to a value that results in ~0.25 of
> rcvbuf. In our case, SO_RCVBUF is set to 65536 by the application, which
> translates to 2 * 65536 = 131,072 bytes in rcvbuf and hence a ~28k
> initial receive window.
>
> Later, even though the scaling_ratio is updated to a more accurate
> skb->len/skb->truesize, which is ~0.66 in our environment, the window
> stays at ~0.25 * rcvbuf. This is because tp->window_clamp does not
> change together with the tp->scaling_ratio update.
< when autotuning is disabled because of SO_RCVBUF >
Most modern applications let the kernel do autotuning, and benefit from the
increased scaling_ratio.
As a result, the
> window size is capped at the initial window_clamp, which is also ~0.25 *
> rcvbuf, and never grows bigger.
>
> This patch increases the initial scaling_ratio from ~25% to 50% in order
> to be backward compatible with the original default
> sysctl_tcp_adv_win_scale.
>
> Fixes: dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale")
> Signed-off-by: Hechao Li <hli@...flix.com>
> Reviewed-by: Tycho Andersen <tycho@...ho.pizza>, Eric Dumazet <edumazet@...gle.com>
This tag is not standard, please use one line per reviewer.
Also please include the link to V1, for further reference.
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Link: https://lore.kernel.org/netdev/20240402215405.432863-1-hli@netflix.com/
Thanks.
Powered by blists - more mailing lists