Why is NFSv4 so slow?

Rick C. Petty rick-freebsd2009 at kiwi-computer.com
Sat Sep 4 02:31:15 UTC 2010

On Mon, Aug 30, 2010 at 09:59:38PM -0400, Rick Macklem wrote:
> I don't tune anything with sysctl, I just use what I get from an
> install from CD onto i386 hardware. (I don't even bother to increase
> kern.ipc.maxsockbuf although I suggest that in the mount message.)

Sure.  But maybe you don't have server mount points with 34k+ files in
them?  I notice when I increase maxsockbuf, the problem of "disappearing
files" goes away, mostly.  Often a "find /mnt" fixes the problem
temporarily, until I unmount and mount again.

> The only thing I can suggest is trying:
> # mount -t newnfs -o nfsv3 <server>:/path /mnt
> and seeing if that performs like the regukar NFSv3 or has
> the perf. issue you see for NFSv4?

Yes, that has the same exact problem.  However, if I use:
	mount -t nfs <server>:/path /mnt
The problem does indeed go away!  But it means I have to mount all the
subdirectories independently, which I'm trying to avoid and is the
reason I went to NFSv4.

> If this does have the perf. issue, then the exp. client
> is most likely the cause and may get better in a few months
> when I bring it up-to-date.

Then that settles it-- the newnfs client seems to be the problem.  Just
to recap...  These two are *terribly* slow (e.g. a VBR mp3 avg 192kbps
cannot be played without skips):
	mount -t newnfs -o nfsv4 server:/path /mnt
	mount -t newnfs -o nfsv3 server:/path /mnt
But this one works just fine (H.264 1080p video does not skip):
	mount -t nfs server:/path /mnt

I guess I will have to wait for you to bring the v4 client up to date.
Thanks again for all of your contributions and for porting NFSv4 to

-- Rick C. Petty

More information about the freebsd-stable mailing list