[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9B9D6296-2A39-4096-9C91-ED5012BE43D8@linux.alibaba.com>
Date: Thu, 23 Apr 2020 18:33:00 +0800
From: Cambda Zhu <cambda@...ux.alibaba.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: netdev <netdev@...r.kernel.org>,
Dust Li <dust.li@...ux.alibaba.com>,
Tony Lu <tonylu@...ux.alibaba.com>
Subject: Re: [PATCH net-next] net: Add TCP_FORCE_LINGER2 to TCP setsockopt
> On Apr 23, 2020, at 16:52, David Laight <David.Laight@...LAB.COM> wrote:
>
> From: Cambda Zhu
>> Sent: 21 April 2020 13:18
>>
>> This patch adds a new TCP socket option named TCP_FORCE_LINGER2. The
>> option has same behavior as TCP_LINGER2, except the tp->linger2 value
>> can be greater than sysctl_tcp_fin_timeout if the user_ns is capable
>> with CAP_NET_ADMIN.
>
> Did you consider adding an extra sysctl so that the limit
> for TCP_LINGER2 could be greater than the default?
>
> It might even be sensible to set the limit to a few times
> the default.
>
> All users can set the socket buffer sizes to twice the default.
> Being able to do the same for the linger timeout wouldn't be a problem.
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
The default tcp_fin_timeout is 60s which may be too long for a server with
tens of thousands connections or qps. To reduce the connections as many as
possible, the system administer may set the sysctl_tcp_fin_timeout and most
of the connections would use the default timeout. The timeout may be very
sensitive. For example if sysctl_tcp_fin_timeout is 10s, 20s may cause double
the FIN-WAIT connections and server load needs to be reevaluated.
Besides from my experience a longer FIN-WAIT timeout will have a better
experience for clients, because there’re some clients, such as video player,
needing to finish the play before closing the connection. If we add a sysctl
with default/max timeout for all users, all connections should be set to the
max timeout except some special requirements which can also be set with
TCP_LINGER2 to use a smaller one.
Maybe my experience is not correct for your scenes, so could you describe
a situation that the timeout with default/max value is better?
Regards,
Cambda
Powered by blists - more mailing lists