2007-10-01 22:04:29

by Wim Colgate

[permalink] [raw]
Subject: simple question about r/wsize

What's the current NFS v3 wsize and rsize? It appears to be 4K - and
just wanted a confirmation.



Thanks,



Wim


Attachments:
(No filename) (228.00 B)
(No filename) (140.00 B)
Download all attachments

2007-10-08 08:46:30

by Greg Banks

[permalink] [raw]
Subject: Re: simple question about r/wsize

On Mon, Oct 01, 2007 at 11:05:40PM -0400, Trond Myklebust wrote:
> On Tue, 2007-10-02 at 04:51 +0200, Gabriel Barazer wrote:
> > On 10/02/2007 1:11:01 AM +0200, Trond Myklebust
> > <[email protected]> wrote:
> > > On Mon, 2007-10-01 at 15:04 -0700, Wim Colgate wrote:
> > >> What???s the current NFS v3 wsize and rsize? It appears to be 4K ??? and
> > >> just wanted a confirmation.
> > >>
> > >
> > > It sounds like you are working with an old system. IIRC, older versions
> > > of RedHat used to jimmy the 'mount' command to make 4k the default,
> > > because that worked best with UDP mounts on crummy networks.
> > >
> > > For newer clients, the default should depend on what your server
> > > specifies in the FSINFO nfs command. For most servers, when you mount
> > > with a TCP connection, the default will be 32k, but some may have larger
> > > defaults (NetApp servers often specify a 64k default) or smaller (older
> > > Linux servers will support an 8k maximum).
> >
> > I see on my servers (>2.6.21, latest nfs-utils) that the rsize/wsize is
> > actually defined by the amount of memory on the NFS server. It seems to
> > set the rsize/wsize to (total memory)/8192 (512k in my case for a 4GB
> > nfs server). Is it a bug or a wanted behavior ?
>
> On a standard 2.6.23-rc8, the server sets RPCSVC_MAXPAYLOAD_TCP == 1MB,
> RPCSVC_MAXPAYLOAD_UDP == 32k. There is no link to the total amount of
> memory.

I think Gabriel may be referring to this code in fs/nfsd/nfssvc.c

202 if (nfsd_max_blksize == 0) {
203 /* choose a suitable default */
204 struct sysinfo i;
205 si_meminfo(&i);
206 /* Aim for 1/4096 of memory per thread
207 * This gives 1MB on 4Gig machines
208 * But only uses 32K on 128M machines.
209 * Bottom out at 8K on 32M and smaller.
210 * Of course, this is only a default.
211 */
212 nfsd_max_blksize = NFSSVC_MAXBLKSIZE;
213 i.totalram <<= PAGE_SHIFT - 12;
214 while (nfsd_max_blksize > i.totalram &&
215 nfsd_max_blksize >= 8*1024*2)
216 nfsd_max_blksize /= 2;
217 }

You can override this default by writing to
/proc/fs/nfsd/max_block_size (before the first nfsd is started,
which basically means modifying /etc/init.d/nfsserver).

Greg.
--
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
Apparently, I'm Bedevere. Which MPHG character are you?
I don't speak for SGI.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-10-01 23:11:15

by Trond Myklebust

[permalink] [raw]
Subject: Re: simple question about r/wsize

T24gTW9uLCAyMDA3LTEwLTAxIGF0IDE1OjA0IC0wNzAwLCBXaW0gQ29sZ2F0ZSB3cm90ZToKPiBX
aGF04oCZcyB0aGUgY3VycmVudCBORlMgdjMgd3NpemUgYW5kIHJzaXplPyBJdCBhcHBlYXJzIHRv
IGJlIDRLIOKAkyBhbmQKPiBqdXN0IHdhbnRlZCBhIGNvbmZpcm1hdGlvbi4KPiAKCkl0IHNvdW5k
cyBsaWtlIHlvdSBhcmUgd29ya2luZyB3aXRoIGFuIG9sZCBzeXN0ZW0uIElJUkMsIG9sZGVyIHZl
cnNpb25zCm9mIFJlZEhhdCB1c2VkIHRvIGppbW15IHRoZSAnbW91bnQnIGNvbW1hbmQgdG8gbWFr
ZSA0ayB0aGUgZGVmYXVsdCwKYmVjYXVzZSB0aGF0IHdvcmtlZCBiZXN0IHdpdGggVURQIG1vdW50
cyBvbiBjcnVtbXkgbmV0d29ya3MuCgpGb3IgbmV3ZXIgY2xpZW50cywgdGhlIGRlZmF1bHQgc2hv
dWxkIGRlcGVuZCBvbiB3aGF0IHlvdXIgc2VydmVyCnNwZWNpZmllcyBpbiB0aGUgRlNJTkZPIG5m
cyBjb21tYW5kLiBGb3IgbW9zdCBzZXJ2ZXJzLCB3aGVuIHlvdSBtb3VudAp3aXRoIGEgVENQIGNv
bm5lY3Rpb24sIHRoZSBkZWZhdWx0IHdpbGwgYmUgMzJrLCBidXQgc29tZSBtYXkgaGF2ZSBsYXJn
ZXIKZGVmYXVsdHMgKE5ldEFwcCBzZXJ2ZXJzIG9mdGVuIHNwZWNpZnkgYSA2NGsgZGVmYXVsdCkg
b3Igc21hbGxlciAob2xkZXIKTGludXggc2VydmVycyB3aWxsIHN1cHBvcnQgYW4gOGsgbWF4aW11
bSkuCgonY2F0IC9wcm9jL21vdW50cycgc2hvdWxkIGFsd2F5cyB0ZWxsIHlvdSB3aGF0IHRoZSBj
bGllbnQgaXMgYWN0dWFsbHkKdXNpbmcgZm9yIHJzaXplL3dzaXplLgoKQ2hlZXJzCiAgVHJvbmQK
CgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tClRoaXMgU0YubmV0IGVtYWlsIGlzIHNwb25zb3JlZCBieTogTWlj
cm9zb2Z0CkRlZnkgYWxsIGNoYWxsZW5nZXMuIE1pY3Jvc29mdChSKSBWaXN1YWwgU3R1ZGlvIDIw
MDUuCmh0dHA6Ly9jbGsuYXRkbXQuY29tL01SVC9nby92c2UwMTIwMDAwMDcwbXJ0L2RpcmVjdC8w
MS8KX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTkZTIG1h
aWxsaXN0ICAtICBORlNAbGlzdHMuc291cmNlZm9yZ2UubmV0Cmh0dHBzOi8vbGlzdHMuc291cmNl
Zm9yZ2UubmV0L2xpc3RzL2xpc3RpbmZvL25mcwo=

2007-10-01 23:19:36

by Wim Colgate

[permalink] [raw]
Subject: Re: simple question about r/wsize

Thanks Trond,

As usual, you are fast to answer; and right. I was looking through the
code and saw 4K being bantered around. However, cat'ing /proc/mounts
shows 32K for rsize and wsize.

Wim

-----Original Message-----
From: Trond Myklebust [mailto:[email protected]]
Sent: Monday, October 01, 2007 4:11 PM
To: Wim Colgate
Cc: [email protected]
Subject: Re: [NFS] simple question about r/wsize

On Mon, 2007-10-01 at 15:04 -0700, Wim Colgate wrote:
> What's the current NFS v3 wsize and rsize? It appears to be 4K - and
> just wanted a confirmation.
>

It sounds like you are working with an old system. IIRC, older versions
of RedHat used to jimmy the 'mount' command to make 4k the default,
because that worked best with UDP mounts on crummy networks.

For newer clients, the default should depend on what your server
specifies in the FSINFO nfs command. For most servers, when you mount
with a TCP connection, the default will be 32k, but some may have larger
defaults (NetApp servers often specify a 64k default) or smaller (older
Linux servers will support an 8k maximum).

'cat /proc/mounts' should always tell you what the client is actually
using for rsize/wsize.

Cheers
Trond


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-10-02 02:52:03

by Gabriel Barazer

[permalink] [raw]
Subject: Re: simple question about r/wsize

T24gMTAvMDIvMjAwNyAxOjExOjAxIEFNICswMjAwLCBUcm9uZCBNeWtsZWJ1c3QgCjx0cm9uZC5t
eWtsZWJ1c3RAZnlzLnVpby5ubz4gd3JvdGU6Cj4gT24gTW9uLCAyMDA3LTEwLTAxIGF0IDE1OjA0
IC0wNzAwLCBXaW0gQ29sZ2F0ZSB3cm90ZToKPj4gV2hhdOKAmXMgdGhlIGN1cnJlbnQgTkZTIHYz
IHdzaXplIGFuZCByc2l6ZT8gSXQgYXBwZWFycyB0byBiZSA0SyDigJMgYW5kCj4+IGp1c3Qgd2Fu
dGVkIGEgY29uZmlybWF0aW9uLgo+Pgo+IAo+IEl0IHNvdW5kcyBsaWtlIHlvdSBhcmUgd29ya2lu
ZyB3aXRoIGFuIG9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S0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tClRoaXMgU0YubmV0IGVtYWlsIGlzIHNwb25zb3JlZCBieTogTWljcm9zb2Z0CkRlZnkg
YWxsIGNoYWxsZW5nZXMuIE1pY3Jvc29mdChSKSBWaXN1YWwgU3R1ZGlvIDIwMDUuCmh0dHA6Ly9j
bGsuYXRkbXQuY29tL01SVC9nby92c2UwMTIwMDAwMDcwbXJ0L2RpcmVjdC8wMS8KX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTkZTIG1haWxsaXN0ICAtICBO
RlNAbGlzdHMuc291cmNlZm9yZ2UubmV0Cmh0dHBzOi8vbGlzdHMuc291cmNlZm9yZ2UubmV0L2xp
c3RzL2xpc3RpbmZvL25mcwo=

2007-10-02 03:05:59

by Trond Myklebust

[permalink] [raw]
Subject: Re: simple question about r/wsize

T24gVHVlLCAyMDA3LTEwLTAyIGF0IDA0OjUxICswMjAwLCBHYWJyaWVsIEJhcmF6ZXIgd3JvdGU6
Cj4gT24gMTAvMDIvMjAwNyAxOjExOjAxIEFNICswMjAwLCBUcm9uZCBNeWtsZWJ1c3QgCj4gPHRy
b25kLm15a2xlYnVzdEBmeXMudWlvLm5vPiB3cm90ZToKPiA+IE9uIE1vbiwgMjAwNy0xMC0wMSBh
dCAxNTowNCAtMDcwMCwgV2ltIENvbGdhdGUgd3JvdGU6Cj4gPj4gV2hhdOKAmXMgdGhlIGN1cnJl
bnQgTkZTIHYzIHdzaXplIGFuZCByc2l6ZT8gSXQgYXBwZWFycyB0byBiZSA0SyDigJMgYW5kCj4g
Pj4ganVzdCB3YW50ZWQgYSBjb25maXJtYXRpb24uCj4gPj4KPiA+IAo+ID4gSXQgc291bmRzIGxp
a2UgeW91IGFyZSB3b3JraW5nIHdpdGggYW4gb2xkIHN5c3RlbS4gSUlSQywgb2xkZXIg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