Olaf Hering
2004-Aug-19 02:19 UTC
[klibc] [PATCH] use reliable nfs mount options per default
Peter, we found that nfs over udp will corrupt data under very extrem load, there is no way to fix it due to the way how UDP works. TCP will not have these problems. I also wonder why the package size is only 1k. Everyone who wishes a slow connection can pass the desired options via the kernel cmdline. Everyone else prefers probably the fast mount. The defaults should look more like that: --- nfsmount/main.c~ 2004-02-12 03:19:14.000000000 +0100 +++ nfsmount/main.c 2004-05-27 13:31:19.000000000 +0200 @@ -20,9 +20,9 @@ static char *progname; static struct nfs_mount_data mount_data = { .version = NFS_MOUNT_VERSION, - .flags = NFS_MOUNT_NONLM, - .rsize = 1024, - .wsize = 1024, + .flags = NFS_MOUNT_NONLM | NFS_MOUNT_VER3 | NFS_MOUNT_TCP, + .rsize = 8192, + .wsize = 8192, .timeo = 7, .retrans = 3, .acregmin = 3, -- USB is for mice, FireWire is for men! sUse lINUX ag, n?RNBERG
H. Peter Anvin
2004-Aug-19 08:46 UTC
[klibc] [PATCH] use reliable nfs mount options per default
Olaf Hering wrote:> Peter, > > we found that nfs over udp will corrupt data under very extrem load, > there is no way to fix it due to the way how UDP works. > TCP will not have these problems. > I also wonder why the package size is only 1k. Everyone who wishes a > slow connection can pass the desired options via the kernel cmdline. > Everyone else prefers probably the fast mount. > The defaults should look more like that: >Presumably the options were taken from the kernel nfsmount, possibly an out-of-date version. I'll apply the patch. -hpa
H. Peter Anvin
2004-Aug-19 08:47 UTC
[klibc] [PATCH] use reliable nfs mount options per default
Olaf Hering wrote:> > --- nfsmount/main.c~ 2004-02-12 03:19:14.000000000 +0100 > +++ nfsmount/main.c 2004-05-27 13:31:19.000000000 +0200 > @@ -20,9 +20,9 @@ static char *progname; > > static struct nfs_mount_data mount_data = { > .version = NFS_MOUNT_VERSION, > - .flags = NFS_MOUNT_NONLM, > - .rsize = 1024, > - .wsize = 1024, > + .flags = NFS_MOUNT_NONLM | NFS_MOUNT_VER3 | NFS_MOUNT_TCP, > + .rsize = 8192, > + .wsize = 8192, > .timeo = 7, > .retrans = 3, > .acregmin = 3, >Actually, would 32K be better (seems to be the default for v3?) -hpa
Olaf Hering
2004-Aug-20 06:38 UTC
[klibc] [PATCH] use reliable nfs mount options per default
On Thu, Aug 19, H. Peter Anvin wrote:> Olaf Hering wrote: > > > >--- nfsmount/main.c~ 2004-02-12 03:19:14.000000000 +0100 > >+++ nfsmount/main.c 2004-05-27 13:31:19.000000000 +0200 > >@@ -20,9 +20,9 @@ static char *progname; > > > > static struct nfs_mount_data mount_data = { > > .version = NFS_MOUNT_VERSION, > >- .flags = NFS_MOUNT_NONLM, > >- .rsize = 1024, > >- .wsize = 1024, > >+ .flags = NFS_MOUNT_NONLM | NFS_MOUNT_VER3 | NFS_MOUNT_TCP, > >+ .rsize = 8192, > >+ .wsize = 8192, > > .timeo = 7, > > .retrans = 3, > > .acregmin = 3, > > > > Actually, would 32K be better (seems to be the default for v3?)Olaf Kirch suggested to set it to 0 and let the server specify the desired size. But that doesnt work for me, I get only 4k. Have to investigate why. -- USB is for mice, FireWire is for men! sUse lINUX ag, n?RNBERG
Olaf Hering
2004-Aug-20 11:46 UTC
[klibc] [PATCH] use reliable nfs mount options per default
On Fri, Aug 20, Olaf Hering wrote:> > Actually, would 32K be better (seems to be the default for v3?) > > Olaf Kirch suggested to set it to 0 and let the server specify the > desired size. But that doesnt work for me, I get only 4k. Have to > investigate why.It was a bug in our kernel. Vanilla kernel should work ok. Can you set both to 0 per default? /lib/klibc/bin/nfsmount -orsize=0,wsize=0 127.0.0.1:/nfsroot/mango /mnt 127.0.0.1:/nfsroot/mango /mnt nfs rw,v3,rsize=32768,wsize=32768,hard,tcp,nolock,addr=127.0.0.1 0 0 -- USB is for mice, FireWire is for men! sUse lINUX ag, n?RNBERG
H. Peter Anvin
2004-Aug-20 11:50 UTC
[klibc] [PATCH] use reliable nfs mount options per default
Olaf Hering wrote:> On Fri, Aug 20, Olaf Hering wrote: > > >>>Actually, would 32K be better (seems to be the default for v3?) >> >>Olaf Kirch suggested to set it to 0 and let the server specify the >>desired size. But that doesnt work for me, I get only 4k. Have to >>investigate why. > > > It was a bug in our kernel. Vanilla kernel should work ok. Can you set > both to 0 per default? > > /lib/klibc/bin/nfsmount -orsize=0,wsize=0 127.0.0.1:/nfsroot/mango /mnt > > 127.0.0.1:/nfsroot/mango /mnt nfs rw,v3,rsize=32768,wsize=32768,hard,tcp,nolock,addr=127.0.0.1 0 0 >Makes sense to me. -hpa