[Bug 267631] slow nfs from FreeBSD guest/client to linux host/server

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 08 Nov 2022 02:12:56 UTC

            Bug ID: 267631
           Summary: slow nfs from FreeBSD guest/client to linux
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: andrew.cagney@gmail.com

First the numbers:

real    11m53.066s
user    0m36.488s
sys     0m5.237s
NetBSD (9.99.something):
real    3m52.182s
user    0m46.372s
sys     0m19.655s
OpenBSD (7.2):
real    3m24.953s
user    0m42.260s
sys     0m9.800s

now the details:

The test is to use build libreswan over NFS on a BSD KVM guest using a Linux
host as the NFS server.  FreeBSD and NetBSD both use GCC so I don't think it is
the compiler (Open uses llvm).

Visually, linking is slower; all binaries are in the same ballpark:
-rwxr-xr-x. 1 cagney qemu   9400760 Nov  7 19:13
-rwxr-xr-x. 1 cagney cagney 9079352 Nov  7 19:24
-rwxr-xr-x. 1 cagney cagney 9817860 Nov  7 19:36
-rwxr-xr-x. 1 cagney cagney 7869320 Nov  7 20:04

KVM Host and NFS server:
  Linux 6.0.5-200.fc36.x86_64
KVM Guest and NFS client (the KVM gets are configured the same way):
  FreeBSD freebsd 13.0-RELEASE FreeBSD 13.0-RELEASE

The vm was created using:

sudo virt-install \
        --connect=qemu:///system --check=path_in_use=off --graphics=none
--virt-type=kvm --noreboot --console=pty,target_type=serial --vcpus=4
--memory=5120  --cpu=host-passthrough
--network=network:swandefault,model=virtio --rng=type=random,device=/dev/random
--security=type=static,model=dac,label='1000:107',relabel=yes \
        --name=m.freebsd \
        --os-variant=freebsd13.1 \
        --disk=cache=writeback,path=/home/pool/m.freebsd.qcow2 \
        --import \

FreeBSD's network interface is:

  vtnet0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 52:54:00:11:50:39
        inet netmask 0xffffff00 broadcast
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active

so it should be virtualized.

FreeBSD's fstab looks like:

# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/vtbd0s1a   /               ufs     rw      1       1
/dev/vtbd0s1b   none            swap    sw      0       0     /pool       nfs     rw    /bench       nfs     rw   /source         nfs     rw  /testing        nfs     rw

so nothing custom (presumably it is using TCP).

Linux's exportfs shows entries such as:


Presumably I've mis-configured FreeBSD but I'm at a loss as to what.

You are receiving this mail because:
You are the assignee for the bug.