Subject: Re: To fix or not to fix?
To: None <current-users@netbsd.org>
From: Richard Rauch <rkr@olib.org>
List: current-users
Date: 06/11/2003 18:31:37
On Wed, Jun 11, 2003 at 06:08:48PM +0100, David Brownlee wrote:
> On Sun, 8 Jun 2003, Richard Rauch wrote:
> 
> > On Sun, Jun 08, 2003 at 11:56:45AM +0100, David Brownlee wrote:
> > > 	You might want to try mounting the nfs filesystem with an 8k or
> > > 	16k block size rather than the (i386) default of 32k.
> > >
> > > 	mount_nfs -r 8192 remote:/dir /local_dir
> >
> > This (and dropping the TCP option) seems to have helped.  (Some time ago,
> > I received the impression that TCP mounts were friendlier and that the
> > original impetus for UDP mounts was no longer appropriate, so I was just
> > using TCP...)
> >
> 	TCP will certainly handle dropped packets more gracefully.

Perhaps more gracefully for the network as a whole...  I seem to remember
something about exponential back-off times in my reading...

But only by turning it off (I originally had it on) and setting the
buffer size to 8K was I able to get pretty good performance.


> > Telling the driver that the chipset only has 8KB seemed to increase the
> > number of overruns per unit time ("Message repeated ??? times..."), but
> > virtually elminated the audible glitches in XMMS playing of .ogg files.
> > (This was before receiving the above suggestion.)
> 
> 	I would expect to see more errors with a smaller buffer. I'm
> 	surprised it works better though...

I was a bit surprised as well.

Maybe "virtually eliminated" was too strong a wording, but they certainly
became *much* shorter, and I think were less frequent.


> > Is this just a fact of life that you sometimes need to do this with
> > NFS and some cards, or does it suggest a driver problem?  The card was
> > not the first one that I tried, but it was the first one that that I
> > tried and that *worked* with NetBSD.
> 
> 	NetBSD (probably from 1.6, though maybe earlier) defaults to
> 	a 32K blocksize on NFS (certainly on i386). This is pretty
> 	much guaranteed to lose on any card with less than 32K (*)
> 	if the remote machine is capable of sending data faster than
> 	the receiving host can handle an interrupt and pull the data
> 	off the card. Obviously this is much worse on a slow bus like
> 	pcmcia.
> 
> 	(*) technically 32K is not enough to handle 32K packets as
> 	extra memory will be used for packet headers and other data
> 
> 	It would be helpful if the mount_nfs manpage had a section
> 	explaining all this. Care to suggest some text? :)

Actually, it looks like a lot of that is already in the 1.6 mount_nfs
page.  I probably didn't think to look at that because the errors started
out with ne0: reporting buffer problems, so I focused on the ethernet card,
rather than the stuff running on my network.

Without talking about specific examples (e.g., PCMCIA cards with smaller
buffers), I'm not sure how much really should be added to the man-page.

(See the PERFORMANCE section of the man-page.)

It might be interesting to know why NetBSD/i386 has 4 times the default
buffer size of all(?) other platforms in NFS v3.


-- 
  "I probably don't know what I'm talking about."  http://www.olib.org/~rkr/