Terrible NFS performance under 9.2-RELEASE?

Rick Macklem rmacklem at uoguelph.ca
Fri Feb 7 01:58:45 UTC 2014


Garrett Wollman wrote:
> The real big improvement, which I have not tried to implement, would
> be to use physical pages (via sfbufs) by sharing the inner loop of
> sendfile(2).  Since I use ZFS as my backing filesystem, I'm not sure
> this would have any benefit for me, but it should be a measurable
> improvement for UFS-backed NFS servers.
(I didn't have this email handy, so I just cut/pasted this paragraph.)

Well, I'm far from sure this is a good idea at this point, but I've
attached a patch that seems to work for a short test of an export of
a UFS volume. (If there is no v_object for ZFS vnodes, it will print
out a message with the error# for EINVAL.) It would need some serious
review and testing before it would be anywhere near ready for head.
(For example, since I hold a LK_SHARED locked vnode which was not
 VI_DOOMED when it was locked, I don't know if I need to acquire a
 reference count on the vm object or if I need to check for OBJ_DEAD?)
The patch checks for OBJ_DEAD, but does not acquire a reference count.
(The reference count part is #ifdef notnow.)

Like most of these things, I don't see a measurable difference on my
old single core i386 hardware with 100Mbps networking, but that only
indicates it might not be a serious regression.

The patch doesn't have yours applied to it, but it should be easy
to integrate the two, since it just adds a call to nfsrv_file_mbuf()
at the beginning of nfsvno_read().

Good luck with the testing, rick
ps: It would be nice to know if it works for ZFS?
pss: If the patch doesn't make it through on the list and you want a
     copy, just email me.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sendfile-nfs.patch
Type: text/x-patch
Size: 15648 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20140206/23d551c2/attachment-0001.bin>


More information about the freebsd-net mailing list