Slow nfs share on Windows client

Hello folks!

I’m having some trouble with an nfs share I have running on Rocky Linux 9.
I want to access it from a Windows 11 machine, both from the local network and from WAN.

I have it set up and working, but it’s really slow for example when opening a Word-document from the client.

I’ve tried from both WiFi, Ethernet and through Wireguard VPN on the client with the same result. I’ve also tried two different routers, TP-Link AX3000 and ASUS RT-AC68-U.
It gets a little better when I disable the firewall on the server, but it’s nowhere near acceptable performance.

This leads me to believe that I have several problems, one being the firewall, the other unknown. Could it be the ethernet driver causing problems on the server? I have the Realtek RTL8111/8168/8411 controller.

Output of nfsstat -r:

Server rpc stats:
calls      badcalls   badfmt     badauth    badclnt
19892      368        368        0          0       

Any input on this matter would be much appreciated, and if you need more info just let me know. Thanks

I don’t know what it is WAN or local network for you.
And what do routers have in common?
Just hook a direct cable between the server and the client and test speed.
And in your published status, is it possible to use a “crystal ball” to guess and guess whether it is NFS3 or NFS4?
Show the NFS server configuration.
Export parameters from NFS
How does the client get hooked?
But first of all check with direct connection what is the speed and then look for problems and solutions for NFS.

Crystal ball, nice one. Well since Windows doesn’t support nfsv4 it is v3. Sorry for not stating version in OP, but no need to be rude about it.

cat /etc/nfs.conf 
#
# This is a general configuration for the
# NFS daemons and tools
#
[general]
# pipefs-directory=/var/lib/nfs/rpc_pipefs
#
[nfsrahead]
# nfs=15000
# nfs4=16000
#
[exports]
# rootdir=/export
#
[exportfs]
# debug=0
#
[gssd]
# verbosity=0
# rpc-verbosity=0
# use-memcache=0
# use-machine-creds=1
use-gss-proxy=1
# avoid-dns=1
# limit-to-legacy-enctypes=0
# context-timeout=0
# rpc-timeout=5
# keytab-file=/etc/krb5.keytab
# cred-cache-directory=
# preferred-realm=
# set-home=1
# upcall-timeout=30
# cancel-timed-out-upcalls=0
#
[lockd]
# port=0
# udp-port=0
#
[exportd]
# debug="all|auth|call|general|parse"
# manage-gids=n
# state-directory-path=/var/lib/nfs
# threads=1
# cache-use-ipaddr=n
# ttl=1800
[mountd]
# debug="all|auth|call|general|parse"
# manage-gids=n
# descriptors=0
# port=0
# threads=1
# reverse-lookup=n
# state-directory-path=/var/lib/nfs
# ha-callout=
# cache-use-ipaddr=n
# ttl=1800
#
[nfsdcld]
# debug=0
# storagedir=/var/lib/nfs/nfsdcld
#
[nfsdcltrack]
# debug=0
# storagedir=/var/lib/nfs/nfsdcltrack
#
[nfsd]
# debug=0
# threads=8
host=[OMITTED]
# port=0
# grace-time=90
# lease-time=90
# udp=n
# tcp=y
#vers3=y
#vers4=n
#vers4.0=n
#vers4.1=n
#vers4.2=n
rdma=y
rdma-port=20049

[statd]
# debug=0
# port=0
# outgoing-port=0
# name=
# state-directory-path=/var/lib/nfs/statd
# ha-callout=
# no-notify=0
#
[sm-notify]
# debug=0
# force=0
# retry-time=900
# outgoing-port=
# outgoing-addr=
# lift-grace=y

#tag1234 - Used for install purposes only

What do you mean get hooked?
I use the following command to mount drive on Windows cmd:

mount -o anon \\192.168.1.100\home\jocke P:

Which gives:

C:\Windows\System32>mount

Local    Remote                                 Properties
-------------------------------------------------------------------------------
P:       \\192.168.1.100\home\jocke             UID=1000, GID=1000
                                                rsize=1048576, wsize=1048576
                                                mount=soft, timeout=0.8
                                                retry=1, locking=no
                                                fileaccess=755, lang=ANSI
                                                casesensitive=no
                                                sec=sys

I’ve tried hard mount, different rsize and wsize to no avail.

But I will try to directly connect to the server and see what happens.

I have also tried to mount the nfs share on an old linux laptop, but that is slow as well when using nfsv3, nfsv4 seems to be snappier.

Please do not take it as an insult or rude treatment!

  1. Hooking - direct cable between server and client.
  2. Speed test of connectivity between them - iperf3 without a firewall
  3. How fast is the disk tract of each of the two machines (server and client)
  4. Export from the server (minimum options) - > ~~~ (rw,sync,no_root_squash)
  5. Test from linux client not windows - mount options ( mount_nfs_default_protocol = 4, browse_mode = no, timeout = 300, dismount_interval = 300) -fstype=nfs4,rw

In my case, with 1 Gbit/s link after mounting the exported content from the server at the client speed is ~480-560 Mbit/s on a single thread and MTU 1500.
At MTU 9000 speed up to ~720 Mbit/s

I’m giving you an example of what to expect.
The results I attached above are for small and large files.
I don’t work with windows and I don’t know how to set it up to squeeze the maximum speed out of it.
For that I say again, check from linux!
If you reach these speeds, and you really want to squeeze even higher speeds, you need to seriously dive into the hardware part.
Starting with the physical drive, how it is connected to the motherboard. How fast is the chipset. How many lines it has and can manage. The network card with what buffers and how the work is organized by the BIOS and the operating system. What optimizations are enforced in the kernel. What mode of operation is assigned to the server’s operating system. Then it goes through the file system and block size of the export files.
After the primary problems presented in this way, only then can you play with the various options on the server and how the content is mounted on the client.

After everything written so far, I hope you really understand me.

Thank you for your replies.

I tried direct ethernet connection, but did not get it to work at all.
There is nothing wrong with the speed when the Windows 11 laptop is connected through ethernet. I get around 95MB/s which seems pretty ok.
There are still delays when opening the nfs share in explorer or when opening a word file.

Would I be wrong to think there are RPC problems, since there are badcalls and badfmt?

I have M.2 NVME drives on both server and laptop.

I will try hooking up a linux client through ethernet and see what happens.
Thanks again!

EDIT: I have mounted the nfs share using both nfsv3 and v4 on a fedora laptop. When mounted using v4 everything works as expected but when using v3 the word file (docx) doesn’t even open with LibreOffice. Also getting badcalls and badfmt every time I try.