2008-01-26 00:49:43

by Paul B. Henson

[permalink] [raw]
Subject: NFS over TCP idle timeout


Does the Linux server implementation of NFS over TCP implement an idle
timeout that automatically disconnects clients after some amount of
inactivity?

I was testing NFSv4 from a Solaris 10 client to a Linux server (Gentoo,
2.6.20). The Solaris client does not tear down the TCP connection upon
system shutdown, which leaves an orphaned established TCP connection on the
server. The connection remained in the established state for days.

Sun support indicates their server automatically disconnects idle clients,
and don't consider not closing the client connection upon shutdown a bug.

I didn't find any documentation regarding the Linux implementation and idle
timeouts, although I did find the following code in net/sunrpc/svcsock.c:

-----
/* apparently the "standard" is that clients close
* idle connections after 5 minutes, servers after
* 6 minutes
* http://www.connectathon.org/talks96/nfstcp.pdf
*/
static int svc_conn_age_period = 6*60;
-----

that would seem to indicate it should close the connection after some
amount of idle time? However, empirically that doesn't seem to happen.

Should idle connections automatically be closed? Are there any tunables or
switches that need to be touched to enable that?

Thanks...


--
Paul B. Henson | (909) 979-6361 | http://www.csupomona.edu/~henson/
Operating Systems and Network Analyst | [email protected]
California State Polytechnic University | Pomona CA 91768


2008-01-29 03:33:54

by Paul B. Henson

[permalink] [raw]
Subject: Re: NFS over TCP idle timeout

On Mon, 28 Jan 2008, J. Bruce Fields wrote:

> On Fri, Jan 25, 2008 at 04:41:00PM -0800, Paul B. Henson wrote:
> >
> > Does the Linux server implementation of NFS over TCP implement an idle
> > timeout that automatically disconnects clients after some amount of
> > inactivity?
>
> That sounds like a server bug to me. Have you checked whether it still
> behaves that way on more recent kernels?

No. I'll probably be upgrading the server to 2.6.23 within the next few
weeks, but given the dearth of information I found in my searches, was
curious whether or not it was supposed to in the first place.

Thanks...


--
Paul B. Henson | (909) 979-6361 | http://www.csupomona.edu/~henson/
Operating Systems and Network Analyst | [email protected]
California State Polytechnic University | Pomona CA 91768

2008-01-29 00:32:24

by J. Bruce Fields

[permalink] [raw]
Subject: Re: NFS over TCP idle timeout

On Fri, Jan 25, 2008 at 04:41:00PM -0800, Paul B. Henson wrote:
>
> Does the Linux server implementation of NFS over TCP implement an idle
> timeout that automatically disconnects clients after some amount of
> inactivity?
>
> I was testing NFSv4 from a Solaris 10 client to a Linux server (Gentoo,
> 2.6.20). The Solaris client does not tear down the TCP connection upon
> system shutdown, which leaves an orphaned established TCP connection on the
> server. The connection remained in the established state for days.
>
> Sun support indicates their server automatically disconnects idle clients,
> and don't consider not closing the client connection upon shutdown a bug.
>
> I didn't find any documentation regarding the Linux implementation and idle
> timeouts, although I did find the following code in net/sunrpc/svcsock.c:
>
> -----
> /* apparently the "standard" is that clients close
> * idle connections after 5 minutes, servers after
> * 6 minutes
> * http://www.connectathon.org/talks96/nfstcp.pdf
> */
> static int svc_conn_age_period = 6*60;
> -----
>
> that would seem to indicate it should close the connection after some
> amount of idle time? However, empirically that doesn't seem to happen.
>
> Should idle connections automatically be closed? Are there any tunables or
> switches that need to be touched to enable that?

That sounds like a server bug to me. Have you checked whether it still
behaves that way on more recent kernels?

--b.