NFS tips and tricks: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
No edit summary
Line 29: Line 29:
calls      badcalls  badfmt    badauth    badclnt
calls      badcalls  badfmt    badauth    badclnt
0          0          0          0          0     
0          0          0          0          0     
</syntaxhighlight>
== Check NFS server supported version ==
$ sudo cat /proc/fs/nfsd/versions<syntaxhighlight lang="bash">
On Ubuntu 20.04, NFS version 2 is disabled. Versions 3 and 4 are enabled. You can verify
$ sudo cat /proc/fs/nfsd/versions
-2 +3 +4 +4.1 +4.2
</syntaxhighlight>
</syntaxhighlight>


== References ==
== References ==
<references />
<references />

Revision as of 10:49, 2 January 2024

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

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

Check NFS server supported version

$ sudo cat /proc/fs/nfsd/versions

On Ubuntu 20.04, NFS version 2 is disabled. Versions 3 and 4 are enabled. You can verify
$ sudo cat /proc/fs/nfsd/versions
-2 +3 +4 +4.1 +4.2

References