If you have a Linux machine as an NFS server, and you reach some high number of clients, you may see warnings in dmesg along the lines of:
nfsd: too many open connections, consider increasing the number of threads
If you use the error message to search for solutions online, you'll find
plenty of explanations saying that you should change the RPCNFSDCOUNT
variable in, e.g.
/etc/default/nfs-kernel-server on a Debian-based
Sometimes the guides will tell you to restart the
nfs-kernel-server-service, but alas, that won't take effect (at least
not immediately(?)) Sometimes the suggestion is then to reboot the
Besides being ugly, that might not be convenient, if - say - a whole lot of machines depend on the NFS mount (which is how we got here in the first place!)
I've now found the solution twice, and this time, I am writing it down!
To change the number of nfsd threads to e.g. 16, you run the command:
# rpc.nfsd 16
The change won't persist a reboot, so you'll still have to change the RPCNFSDCOUNT variable, but it will take effect immediately. The number you specify is the desired total number of nfsds.
You can check the number using
ps faux | grep [n]fsd | wc -l or
looking at the first number in
grep ^th /proc/net/rpc/nfsd.