Subject: starting 90-second grace period

hi all,

Is there anyway to reduce or remove "90-second grace period" ?

I could not find any configurable parameter.

grace_time seems to be derived from user_lease_time & lease_time.

what are the negative effects of changing *_lease_time ?

cheers
--
Tharindu Rukshan Bamunuarachchi


2009-12-11 17:08:51

by Andy Adamson

[permalink] [raw]
Subject: Re: starting 90-second grace period

you can set the lease time, which is the grace period, by writing to

/proc/fs/nfsd/nfsv4leasetime

note that this file is only available after the nfsd module is loaded,
and is only read by nfsd upon startup.

-->Andy

On Dec 11, 2009, at 6:00 AM, Tharindu Rukshan Bamunuarachchi wrote:

> hi all,
>
> Is there anyway to reduce or remove "90-second grace period" ?
>
> I could not find any configurable parameter.
>
> grace_time seems to be derived from user_lease_time & lease_time.
>
> what are the negative effects of changing *_lease_time ?
>
> cheers
> --
> Tharindu Rukshan Bamunuarachchi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs"
> in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html


2009-12-11 18:20:41

by Trond Myklebust

[permalink] [raw]
Subject: Re: starting 90-second grace period

On Fri, 2009-12-11 at 23:39 +0530, Tharindu Rukshan Bamunuarachchi
wrote:
> then why is it 90 by default ... is it RFC/Protocol requirement ?

The purpose of the grace period is to give the clients enough time to
notice that the server has rebooted, and to reclaim their existing locks
without danger of having somebody else steal the lock from them.

It is not a protocol requirement, but it is definitely a strongly
recommended feaature if you don't want to see corruption in your
mailbox/database/logfile/... that relies on those locks.

Trond

> On Fri, Dec 11, 2009 at 11:31 PM, Trond Myklebust
> <[email protected]> wrote:
> > On Fri, 2009-12-11 at 22:55 +0530, Tharindu Rukshan Bamunuarachchi
> > wrote:
> >> thankx a lot for the info.
> >>
> >> btw, if i set nfs4leasetime to ~10 seconds ... is there any negative effect ?
> >>
> >
> > You mean aside from the very likely event that your clients will lose
> > all their locks when the server reboots?
> >
> > Trond
> >
> >
>
>
>




2009-12-11 18:01:53

by Trond Myklebust

[permalink] [raw]
Subject: Re: starting 90-second grace period

On Fri, 2009-12-11 at 22:55 +0530, Tharindu Rukshan Bamunuarachchi
wrote:
> thankx a lot for the info.
>
> btw, if i set nfs4leasetime to ~10 seconds ... is there any negative effect ?
>

You mean aside from the very likely event that your clients will lose
all their locks when the server reboots?

Trond


Subject: Re: starting 90-second grace period

thankx a lot for the info.

btw, if i set nfs4leasetime to ~10 seconds ... is there any negative ef=
fect ?



On Fri, Dec 11, 2009 at 10:38 PM, Andy Adamson <[email protected]> wrot=
e:
> you can set the lease time, which is the grace period, by writing to
>
> /proc/fs/nfsd/nfsv4leasetime
>
> note that this file is only available after the nfsd module is loaded=
, and
> is only read by nfsd upon startup.
>
> -->Andy
>
> On Dec 11, 2009, at 6:00 AM, Tharindu Rukshan Bamunuarachchi wrote:
>
>> hi all,
>>
>> Is there anyway to reduce or remove "90-second grace period" ?
>>
>> I could not find any configurable parameter.
>>
>> grace_time seems to be derived from user_lease_time & lease_time.
>>
>> what are the negative effects of changing *_lease_time ?
>>
>> cheers
>> --
>> Tharindu Rukshan Bamunuarachchi
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs"=
in
>> the body of a message to [email protected]
>> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>
>



--=20
Tharindu Rukshan Bamunuarachchi

Subject: Re: starting 90-second grace period

then why is it 90 by default ... is it RFC/Protocol requirement ?

On Fri, Dec 11, 2009 at 11:31 PM, Trond Myklebust
<[email protected]> wrote:
> On Fri, 2009-12-11 at 22:55 +0530, Tharindu Rukshan Bamunuarachchi
> wrote:
>> thankx a lot for the info.
>>
>> btw, if i set nfs4leasetime to ~10 seconds ... is there any negative effect ?
>>
>
> You mean aside from the very likely event that your clients will lose
> all their locks when the server reboots?
>
> Trond
>
>



--
Tharindu Rukshan Bamunuarachchi

2009-12-11 19:50:45

by J. Bruce Fields

[permalink] [raw]
Subject: Re: starting 90-second grace period

On Fri, Dec 11, 2009 at 01:20:43PM -0500, Trond Myklebust wrote:
> On Fri, 2009-12-11 at 23:39 +0530, Tharindu Rukshan Bamunuarachchi
> wrote:
> > then why is it 90 by default ... is it RFC/Protocol requirement ?
>
> The purpose of the grace period is to give the clients enough time to
> notice that the server has rebooted, and to reclaim their existing locks
> without danger of having somebody else steal the lock from them.
>
> It is not a protocol requirement, but it is definitely a strongly
> recommended feaature if you don't want to see corruption in your
> mailbox/database/logfile/... that relies on those locks.

There are a few things we could do to lessen the pain of the grace
period, though--such as ending it when we know it's done. (In the v4
case, that's just when we know there are no clients to recover state; in
the v4.1 case, that's when all the RECLAIM_COMPLETE's are done.)

I'm hoping to work on that for 2.6.34.

--b.

2009-12-11 20:09:30

by Trond Myklebust

[permalink] [raw]
Subject: Re: starting 90-second grace period

On Fri, 2009-12-11 at 14:50 -0500, J. Bruce Fields wrote:
> On Fri, Dec 11, 2009 at 01:20:43PM -0500, Trond Myklebust wrote:
> > On Fri, 2009-12-11 at 23:39 +0530, Tharindu Rukshan Bamunuarachchi
> > wrote:
> > > then why is it 90 by default ... is it RFC/Protocol requirement ?
> >
> > The purpose of the grace period is to give the clients enough time to
> > notice that the server has rebooted, and to reclaim their existing locks
> > without danger of having somebody else steal the lock from them.
> >
> > It is not a protocol requirement, but it is definitely a strongly
> > recommended feaature if you don't want to see corruption in your
> > mailbox/database/logfile/... that relies on those locks.
>
> There are a few things we could do to lessen the pain of the grace
> period, though--such as ending it when we know it's done. (In the v4
> case, that's just when we know there are no clients to recover state; in
> the v4.1 case, that's when all the RECLAIM_COMPLETE's are done.)

You can't clear the grace period unless you know that all 3 protocols
are done. I.e. the list of NSM monitored clients was empty, the list of
NFSv4 clients was empty, and the NFSv4.1 reclaim_completes are all done
(or the list was empty).

In no case should it be done by adjusting the duration of the lease
period.

Trond


2009-12-11 20:12:14

by J. Bruce Fields

[permalink] [raw]
Subject: Re: starting 90-second grace period

On Fri, Dec 11, 2009 at 03:09:31PM -0500, Trond Myklebust wrote:
> On Fri, 2009-12-11 at 14:50 -0500, J. Bruce Fields wrote:
> > On Fri, Dec 11, 2009 at 01:20:43PM -0500, Trond Myklebust wrote:
> > > On Fri, 2009-12-11 at 23:39 +0530, Tharindu Rukshan Bamunuarachchi
> > > wrote:
> > > > then why is it 90 by default ... is it RFC/Protocol requirement ?
> > >
> > > The purpose of the grace period is to give the clients enough time to
> > > notice that the server has rebooted, and to reclaim their existing locks
> > > without danger of having somebody else steal the lock from them.
> > >
> > > It is not a protocol requirement, but it is definitely a strongly
> > > recommended feaature if you don't want to see corruption in your
> > > mailbox/database/logfile/... that relies on those locks.
> >
> > There are a few things we could do to lessen the pain of the grace
> > period, though--such as ending it when we know it's done. (In the v4
> > case, that's just when we know there are no clients to recover state; in
> > the v4.1 case, that's when all the RECLAIM_COMPLETE's are done.)
>
> You can't clear the grace period unless you know that all 3 protocols
> are done. I.e. the list of NSM monitored clients was empty, the list of
> NFSv4 clients was empty, and the NFSv4.1 reclaim_completes are all done
> (or the list was empty).

Yup.

> In no case should it be done by adjusting the duration of the lease
> period.

Agreed.

--b.