Why is NFSv4 so slow?

Rick Macklem rmacklem at uoguelph.ca
Tue Aug 31 01:59:40 UTC 2010


> 
> Well I wouldn't say "well". Every client I've set up has had this
> issue,
> and somehow through tweaking various settings and restarting nfs a
> bunch of
> times, I've been able to make it tolerable for most clients. Only one
> client is behaving well, and that happens to be the only machine I
> haven't
> rebooted since I enabled NFSv4. Other clients are seeing 2-3 MiB/s on
> my
> dd(1) test.
> 
All I can tell you is that, for my old hardware (100Mbps networking)
I see 10Mbytes/sec (all you can hope for) using the regular NFSv3
client. I see about 10% slower for NFSv3 and NFSv4 using the experimental
client (NFSv3 and NFSv4 about identical). The 10% doesn't surprise me,
since the experimental client is based on a FreeBSD6 client and,
although I plan on carrying all the newer client changes over to
it, I haven't gotten around to doing that. If it is still 10% slower
after the changes are carried over, I will be looking at why.

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.)

I also do not specify any mount options other than the protocol
version. My mount commands look like:
# mount -t nfs -o nfsv3 <server>:/path /mnt
# mount -t newnfs -o nfsv3 <server<:/path /mnt
# mount -t nfs -o nfsv4 <server>:/path /mnt

So, I don't see dramatically slower NFSv4 and expect to get the 10%
perf. reduction fixed when I bring the exp. client in line with
the current one, but can't be sure.

So, I have no idea what you are seeing. It might be an issue
that will be fixed when I bring the exp. client up to date,
but I have no idea if that's the case? (It will be a few
months before the client update happens.)

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?

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.

rick



More information about the freebsd-stable mailing list