2008-03-08 10:11:49

by Timo Sirainen

[permalink] [raw]
Subject: NFS server waking up sleeping disks

My Linux 2.6.24.1 NFS server has two disks. One of them is rarely used,
so it's normally sleeping and is not even mounted anywhere. But after
the NFS mount hasn't been used for a while (some hours?) doing just a
"ls" on NFS client causes the sleeping disk to wake up and the "ls"
reply is delayed a few seconds until the wakeup is finished.

Any ideas why it's waking up the disk that has nothing to do with NFS,
and how to prevent it from doing this?

Using NFSv3 with export options *(ro,insecure,no_subtree_check)


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2008-03-08 13:59:39

by Timo Reimann

[permalink] [raw]
Subject: Re: NFS server waking up sleeping disks

Timo Sirainen wrote:
> My Linux 2.6.24.1 NFS server has two disks. One of them is rarely used,
> so it's normally sleeping and is not even mounted anywhere. But after
> the NFS mount hasn't been used for a while (some hours?) doing just a
> "ls" on NFS client causes the sleeping disk to wake up and the "ls"
> reply is delayed a few seconds until the wakeup is finished.
>
> Any ideas why it's waking up the disk that has nothing to do with NFS,
> and how to prevent it from doing this?

Your issue might be related to the same that I have (which is still
unresolved). Basically, my non-mounted backup disk keeps spinning up
after a rough 20-25 minutes of sleeping. Check out my archived thread
for details and hints how to determine disk-accessing processes:

http://marc.info/?l=linux-nfs&m=120354580303104&w=2

However, there is no `ls' or similar call required to wake up my disk.
It just happens.


Regards,

--Timo (too)

2008-03-08 23:27:47

by Timo Sirainen

[permalink] [raw]
Subject: Re: NFS server waking up sleeping disks

On Sat, 2008-03-08 at 14:59 +0100, Timo Reimann wrote:
> Timo Sirainen wrote:
> > My Linux 2.6.24.1 NFS server has two disks. One of them is rarely used,
> > so it's normally sleeping and is not even mounted anywhere. But after
> > the NFS mount hasn't been used for a while (some hours?) doing just a
> > "ls" on NFS client causes the sleeping disk to wake up and the "ls"
> > reply is delayed a few seconds until the wakeup is finished.
> >
> > Any ideas why it's waking up the disk that has nothing to do with NFS,
> > and how to prevent it from doing this?
>
> Your issue might be related to the same that I have (which is still
> unresolved). Basically, my non-mounted backup disk keeps spinning up
> after a rough 20-25 minutes of sleeping. Check out my archived thread
> for details and hints how to determine disk-accessing processes:
>
> http://marc.info/?l=linux-nfs&m=120354580303104&w=2
>
> However, there is no `ls' or similar call required to wake up my disk.
> It just happens.

Thanks, mountd is indeed the problem:

01:22:06.662763 open("/proc/partitions", O_RDONLY) = 9
..
01:22:06.663000 open("/dev/hda6", O_RDONLY) = 11
..
01:22:06.663175 read(11, "&s\301_\177{/x\24d\240\262\264\256a\374yy\327\6`l/\271"..., 4096) = 4096
01:22:11.678610 lseek(11, 0, SEEK_SET) = 0

I'll go figure out why it's doing this.


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2008-03-09 02:58:26

by Timo Reimann

[permalink] [raw]
Subject: Re: NFS server waking up sleeping disks

Timo Sirainen wrote:
> On Sat, 2008-03-08 at 14:59 +0100, Timo Reimann wrote:
>> Timo Sirainen wrote:
>>> My Linux 2.6.24.1 NFS server has two disks. One of them is rarely used,
>>> so it's normally sleeping and is not even mounted anywhere. But after
>>> the NFS mount hasn't been used for a while (some hours?) doing just a
>>> "ls" on NFS client causes the sleeping disk to wake up and the "ls"
>>> reply is delayed a few seconds until the wakeup is finished.
>>>
>>> Any ideas why it's waking up the disk that has nothing to do with NFS,
>>> and how to prevent it from doing this?
>> Your issue might be related to the same that I have (which is still
>> unresolved). Basically, my non-mounted backup disk keeps spinning up
>> after a rough 20-25 minutes of sleeping. Check out my archived thread
>> for details and hints how to determine disk-accessing processes:
>>
>> http://marc.info/?l=linux-nfs&m=120354580303104&w=2
>>
>> However, there is no `ls' or similar call required to wake up my disk.
>> It just happens.
>
> Thanks, mountd is indeed the problem:
>
> I'll go figure out why it's doing this.

If you find a solution prior to the other guys who offered their help to
me, please let us (especially me :) ) know.


--Timo

2008-03-09 03:11:22

by Timo Sirainen

[permalink] [raw]
Subject: Re: NFS server waking up sleeping disks

On Mar 9, 2008, at 4:58 AM, Timo Reimann wrote:

>>> However, there is no `ls' or similar call required to wake up my
>>> disk.
>>> It just happens.
>>
>> Thanks, mountd is indeed the problem:
>>
>> I'll go figure out why it's doing this.
>
> If you find a solution prior to the other guys who offered their
> help to
> me, please let us (especially me :) ) know.

Well, after half an hour of looking at mountd and libblk code and
trying to figure out why I can't seem to find the code for what I see
in the strace, I finally found out the mountd sources were newer than
what I was using and this issue was already fixed (Debian unstable):

* 10-no-flush-blkid-cache.diff: New patch from Theodore Ts'o, removes
unneccessary flushing of the blkid cache, leading to lots of
spurious
DM_* ioctls. (Closes: #431940)

This appears to fix my problem, although it'll probably takes a few
days until I'm sure. This is the second time already when I've wasted
a lot of time trying to figure out a problem, only to find out that
dist-upgrade would have solved it. Have to remember to do that the
next time. :)


Attachments:
PGP.sig (194.00 B)
This is a digitally signed message part

2008-03-09 19:50:59

by Timo Reimann

[permalink] [raw]
Subject: Re: NFS server waking up sleeping disks

Timo Sirainen wrote:
> On Mar 9, 2008, at 4:58 AM, Timo Reimann wrote:
>
>>>> However, there is no `ls' or similar call required to wake up my disk.
>>>> It just happens.
>>>
>>> Thanks, mountd is indeed the problem:
>>>
>>> I'll go figure out why it's doing this.
>>
>> If you find a solution prior to the other guys who offered their help to
>> me, please let us (especially me :) ) know.
>
> Well, after half an hour of looking at mountd and libblk code and trying
> to figure out why I can't seem to find the code for what I see in the
> strace, I finally found out the mountd sources were newer than what I
> was using and this issue was already fixed (Debian unstable):
>
> This appears to fix my problem, although it'll probably takes a few days
> until I'm sure. This is the second time already when I've wasted a lot
> of time trying to figure out a problem, only to find out that
> dist-upgrade would have solved it. Have to remember to do that the next
> time. :)

Thanks a lot for the hint, that seems to have fixed it for me as well. I
was previously looking over the changelog too but couldn't relate any of
the entries to my issue successfully. Double-checking whatever I was
doing might have helped my case as well. :)

Like you, I won't be absolutely sure before at least 24h of testing have
passed, but so far there hasn't been a single undesirable spinup of my
backup disk for the last couple of hours. As mentioned before, my disk
wouldn't stay quiet for more than 25 minutes.

For whom it may concern: I'm running Ubuntu Gutsy and did a backport of
nfs-utils 1.1.1-12ubuntu3, currently contained in Hardy.


Cheers,

--Timo