public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* Text based mount options ignoring the preferred rwsize?
@ 2009-09-08 16:47 James Pearson
       [not found] ` <4AA68AA4.7090606-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: James Pearson @ 2009-09-08 16:47 UTC (permalink / raw)
  To: linux-nfs

I've noticed a difference in the rsize used when mounting a file system 
  between using text and binary mount options.

The client is running a CentOS5 based distro with a 2.6.32-rc8 kernel

The server has a preferred rsize of 128kb and maximum rsize of 512kb

When I use mount.nfs from CentOS5/RHEL5 nfs-utils (based on v1.0.9) and 
don't give any rsize option, it mounts the file system with a rsize of 
128kb. This uses binary mount options

But, when using mount.nfs from nfs-utils 1.2.0, the file system is 
mounted with an rsize of 512kb

Looking at the nfs-utils and kernel source, it appears that for binary 
options, rsize is set to 0 if not given by mount.nfs, and the kernel 
eventually, in this case, increases this to preferred size.

But for text mount options, if not set by mount.nfs, the default size is 
  set to NFS_MAX_FILE_IO_SIZE in the kernel, which, in this case, gets 
reduced to the server maximum size.

Should the kernel be setting rsize (and wsize) to 0 by default?

Thanks

James Pearson

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Text based mount options ignoring the preferred rwsize?
       [not found] ` <4AA68AA4.7090606-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
@ 2009-09-09 19:23   ` Chuck Lever
  2009-09-09 21:47     ` James Pearson
  0 siblings, 1 reply; 7+ messages in thread
From: Chuck Lever @ 2009-09-09 19:23 UTC (permalink / raw)
  To: James Pearson; +Cc: linux-nfs

On Sep 8, 2009, at 12:47 PM, James Pearson wrote:
> I've noticed a difference in the rsize used when mounting a file  
> system  between using text and binary mount options.
>
> The client is running a CentOS5 based distro with a 2.6.32-rc8 kernel
>
> The server has a preferred rsize of 128kb and maximum rsize of 512kb
>
> When I use mount.nfs from CentOS5/RHEL5 nfs-utils (based on v1.0.9)  
> and don't give any rsize option, it mounts the file system with a  
> rsize of 128kb. This uses binary mount options
>
> But, when using mount.nfs from nfs-utils 1.2.0, the file system is  
> mounted with an rsize of 512kb
>
> Looking at the nfs-utils and kernel source, it appears that for  
> binary options, rsize is set to 0 if not given by mount.nfs, and the  
> kernel eventually, in this case, increases this to preferred size.
>
> But for text mount options, if not set by mount.nfs, the default  
> size is  set to NFS_MAX_FILE_IO_SIZE in the kernel, which, in this  
> case, gets reduced to the server maximum size.
>
> Should the kernel be setting rsize (and wsize) to 0 by default?

nfs(5) says:

"If an [rw]size value is not specified, or if the specified [rw]size  
value is larger than the maximum that either client or server can  
support, the client and server negotiate the largest [rw]size value  
that they can both support."

So the text-based behavior is what is documented now.

Does anyone know of a reason to use the server's "preferred" transfer  
size rather than the largest size supported by both client and  
server?  Usually those are the same.

> Thanks
>
> James Pearson
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs"  
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Text based mount options ignoring the preferred rwsize?
  2009-09-09 19:23   ` Chuck Lever
@ 2009-09-09 21:47     ` James Pearson
       [not found]       ` <4AA8225A.9060107-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: James Pearson @ 2009-09-09 21:47 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs

Chuck Lever wrote:
>>
>> Should the kernel be setting rsize (and wsize) to 0 by default?
> 
> 
> nfs(5) says:
> 
> "If an [rw]size value is not specified, or if the specified [rw]size  
> value is larger than the maximum that either client or server can  
> support, the client and server negotiate the largest [rw]size value  
> that they can both support."
> 
> So the text-based behavior is what is documented now.
> 
> Does anyone know of a reason to use the server's "preferred" transfer  
> size rather than the largest size supported by both client and  server?  
> Usually those are the same.

In this case, the manufacturer of the NFS server recommends using 128Kb 
for rsize and 512Kb for wsize - although the maximum rsize it supports 
is 512Kb. I assume in their testing, these values have given optimal 
performance figures.

The default behaviour with binary mount options when no [rw]size is to 
select these preferred values - which to me, makes sense - as by not 
giving a [rw]size, you are leaving it up the server to pick the 'best' 
values for you - which I guess in most (all other?) cases happen to be 
the maximum size.

James Pearson

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Text based mount options ignoring the preferred rwsize?
       [not found]       ` <4AA8225A.9060107-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
@ 2009-09-09 22:34         ` Chuck Lever
  2009-09-09 22:56         ` Trond Myklebust
  1 sibling, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2009-09-09 22:34 UTC (permalink / raw)
  To: James Pearson; +Cc: linux-nfs

On Sep 9, 2009, at 5:47 PM, James Pearson wrote:
> Chuck Lever wrote:
>>>
>>> Should the kernel be setting rsize (and wsize) to 0 by default?
>> nfs(5) says:
>> "If an [rw]size value is not specified, or if the specified  
>> [rw]size  value is larger than the maximum that either client or  
>> server can  support, the client and server negotiate the largest  
>> [rw]size value  that they can both support."
>> So the text-based behavior is what is documented now.
>> Does anyone know of a reason to use the server's "preferred"  
>> transfer  size rather than the largest size supported by both  
>> client and  server?  Usually those are the same.
>
> In this case, the manufacturer of the NFS server recommends using  
> 128Kb for rsize and 512Kb for wsize - although the maximum rsize it  
> supports is 512Kb. I assume in their testing, these values have  
> given optimal performance figures.

In this case maybe you should set these explicitly.

> The default behaviour with binary mount options when no [rw]size is  
> to select these preferred values - which to me, makes sense - as by  
> not giving a [rw]size, you are leaving it up the server to pick the  
> 'best' values for you - which I guess in most (all other?) cases  
> happen to be the maximum size.

It might make sense to think of the server's preference as the value  
you should use.  But for the client, the larger the better in nearly  
every case.  So which one should you choose by default?

Someone could still make the case that the old behavior was better in  
some way (and provide benchmark evidence for this, of course, for  
multiple combinations of implementations across different networks).

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Text based mount options ignoring the preferred rwsize?
       [not found]       ` <4AA8225A.9060107-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
  2009-09-09 22:34         ` Chuck Lever
@ 2009-09-09 22:56         ` Trond Myklebust
       [not found]           ` <1252536970.8722.110.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Trond Myklebust @ 2009-09-09 22:56 UTC (permalink / raw)
  To: James Pearson; +Cc: Chuck Lever, linux-nfs

On Wed, 2009-09-09 at 22:47 +0100, James Pearson wrote:
> The default behaviour with binary mount options when no [rw]size is to 
> select these preferred values - which to me, makes sense - as by not 
> giving a [rw]size, you are leaving it up the server to pick the 'best' 
> values for you - which I guess in most (all other?) cases happen to be 
> the maximum size.

Right. The above was indeed the guiding principle back when I did the
rsize/wsize negotiation for NFSv3 and NFSv2 for the binary mount code.

The NFS protocol specifies that the maximum values are there to tell you
that the server will do short read/writes if you exceed these. However,
the preferred values may correspond to a different 'sweet spot' for the
server read and write implementations.

Cheers
    Trond


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Text based mount options ignoring the preferred rwsize?
       [not found]           ` <1252536970.8722.110.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-09-10  9:08             ` James Pearson
       [not found]               ` <4AA8C215.2030002-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: James Pearson @ 2009-09-10  9:08 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Chuck Lever, linux-nfs

Trond Myklebust wrote:
> On Wed, 2009-09-09 at 22:47 +0100, James Pearson wrote:
> 
>>The default behaviour with binary mount options when no [rw]size is to 
>>select these preferred values - which to me, makes sense - as by not 
>>giving a [rw]size, you are leaving it up the server to pick the 'best' 
>>values for you - which I guess in most (all other?) cases happen to be 
>>the maximum size.
> 
> 
> Right. The above was indeed the guiding principle back when I did the
> rsize/wsize negotiation for NFSv3 and NFSv2 for the binary mount code.
> 
> The NFS protocol specifies that the maximum values are there to tell you
> that the server will do short read/writes if you exceed these. However,
> the preferred values may correspond to a different 'sweet spot' for the
> server read and write implementations.

So does that mean that the binary mount options are doing the right 
thing, whereas the text mount options are not? Also, just to confirm, 
I'm using NFSv3.

Thanks

James Pearson

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Text based mount options ignoring the preferred rwsize?
       [not found]               ` <4AA8C215.2030002-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
@ 2009-09-10 17:49                 ` Chuck Lever
  0 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2009-09-10 17:49 UTC (permalink / raw)
  To: James Pearson; +Cc: Trond Myklebust, linux-nfs

On Sep 10, 2009, at 5:08 AM, James Pearson wrote:
> Trond Myklebust wrote:
>> On Wed, 2009-09-09 at 22:47 +0100, James Pearson wrote:
>>> The default behaviour with binary mount options when no [rw]size  
>>> is to select these preferred values - which to me, makes sense -  
>>> as by not giving a [rw]size, you are leaving it up the server to  
>>> pick the 'best' values for you - which I guess in most (all  
>>> other?) cases happen to be the maximum size.
>> Right. The above was indeed the guiding principle back when I did the
>> rsize/wsize negotiation for NFSv3 and NFSv2 for the binary mount  
>> code.
>> The NFS protocol specifies that the maximum values are there to  
>> tell you
>> that the server will do short read/writes if you exceed these.  
>> However,
>> the preferred values may correspond to a different 'sweet spot' for  
>> the
>> server read and write implementations.
>
> So does that mean that the binary mount options are doing the right  
> thing, whereas the text mount options are not? Also, just to  
> confirm, I'm using NFSv3.

I don't think there is a clear right or wrong here.  The binary  
behavior follows protocol guidelines, which is fine.  But, there are  
plenty of cases where using the server's preferred size by default is  
not always optimal.  For example, the server may advertise a  
preference for 32768, but using that setting with UDP on a congested  
network would result in poor performance.

In other words, the client may decide that using a larger or smaller  
setting than the server's preference would be better.  Or, it may use  
the largest possible setting for r/wsize, but advertise the server's  
preference number in stat(2) results.

Fwiw, I don't have any problem switching the text-based defaults to  
zero.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-10 17:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-08 16:47 Text based mount options ignoring the preferred rwsize? James Pearson
     [not found] ` <4AA68AA4.7090606-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
2009-09-09 19:23   ` Chuck Lever
2009-09-09 21:47     ` James Pearson
     [not found]       ` <4AA8225A.9060107-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
2009-09-09 22:34         ` Chuck Lever
2009-09-09 22:56         ` Trond Myklebust
     [not found]           ` <1252536970.8722.110.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-09-10  9:08             ` James Pearson
     [not found]               ` <4AA8C215.2030002-5Ol4pYTxKWu0ML75eksnrtBPR1lH4CV8@public.gmane.org>
2009-09-10 17:49                 ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox