NFS tips and tricks

From HPCWIKI
Revision as of 09:56, 2 January 2024 by Admin (talk | contribs)
Jump to navigation Jump to search

nfsd: too many open connections, consider increasing the number of threads

NFS uses threads on the server to handle incoming and outgoing I/O requests. Using threads helps NFS scale to handle large numbers of clients and large numbers of I/O requests.

dmesg display when reach some high number of clients. should increase Number of NFS daemons (nfsd) by changing the RPCNFSDCOUNT variable in /etc/default/nfs-kernel-server on a Debian-based machine. (Ubuntu 20.04)

Find the number of NFS daemons in two ways
ps -aux | grep nfs
or 
$ ps -aux | grep nfs | wc -l

To change nfsd count temperarly, use 
# rpc.nfsd 16

To change nfsd count permenently increase RPCNFSDCOUNT variable in  /etc/default/nfs-kernel-server (Ubuntu 20.04) 
then  restart nfs server.
$ cat /etc/default/nfs-kernel-server 
# Number of servers to start up
RPCNFSDCOUNT=64
...
$ sudo systemctl restart nfs-server.service
$ ps -aux | grep nfs | wc -l                
65

Check nfs status

$ nfsstat -r
Server rpc stats:
calls      badcalls   badfmt     badauth    badclnt
0          0          0          0          0

References