On Thu, 23 Nov 2023 at 00:03, Calum Mackay <calum.mackay@xxxxxxxxxx> wrote: > > hi Ced, > > On 22/11/2023 10:48 pm, Cedric Blancher wrote: > > On Mon, 20 Nov 2023 at 03:57, Olga Kornievskaia <aglo@xxxxxxxxx> wrote: > >> > >> Hi Ced, > >> > >> Why do you think it doesn't use it? Have you looked at a network trace > >> of an idle connection? I seem to recall seeing keep-alive being used. > > > > Well, I don't see a setsockopt(TCP_KEEPALIVE) in the libtirpc code? > > We have this, in the kernel RPC code: > > https://elixir.bootlin.com/linux/latest/source/net/sunrpc/xprtsock.c#L2257 > > which might be it. Yay, But how does the kernel get the fd from libtirpc? Also, how can I turn this: /* TCP Keepalive options */ sock_set_keepalive(sock->sk); tcp_sock_set_keepidle(sock->sk, keepidle); tcp_sock_set_keepintvl(sock->sk, keepidle); tcp_sock_set_keepcnt(sock->sk, keepcnt); /* TCP user timeout (see RFC5482) */ tcp_sock_set_user_timeout(sock->sk, timeo); into setsockopt() from userland code? Does the BSD socket library have such options? Ced > > cheers, > calum. > > > > > Ced > > > >> > >> On Fri, Nov 17, 2023 at 8:02 PM Cedric Blancher > >> <cedric.blancher@xxxxxxxxx> wrote: > >>> > >>> Good morning! > >>> > >>> Why does the Linux NFS client not use TCP_KEEPALIVE for its TCP > >>> connections? What are the pro and cons of using that for NFS TCP > >>> connections? > >>> > >>> Ced > >>> -- > >>> Cedric Blancher <cedric.blancher@xxxxxxxxx> > >>> [https://plus.google.com/u/0/+CedricBlancher/] > >>> Institute Pasteur > > > > > > > > -- > Calum Mackay > Linux Kernel Engineering > Oracle Linux and Virtualisation > -- Cedric Blancher <cedric.blancher@xxxxxxxxx> [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur