meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:remotefs:nfs [2025/02/26 08:19] niziaklinux:remotefs:nfs [2025/02/26 08:43] (current) niziak
Line 1: Line 1:
 ====== NFS ====== ====== NFS ======
 +
 +[[https://stackoverflow.com/questions/72493803/why-did-nfs-switch-from-udp-to-tcp-as-the-standard-protocol-in-version-4]]
 +
 +  A new feature, available for both 2.4 and 2.5 kernels but not yet integrated into the mainstream kernel at the time 
 +  of this writing, is NFS over TCP. Using TCP has a   distinct advantage and a distinct disadvantage over UDP. 
 +  The advantage is that it works far better than UDP on lossy networks. When using TCP, a single dropped packet 
 +  can be retransmitted, without the retransmission of the entire RPC request, resulting in better performance 
 +  on lossy networks. In addition, TCP will handle network speed differences better than UDP, due to the underlying 
 +  flow control at the network level. 
 +
 +===== performance =====
 +
 +On server ''/etc/exports'':
 +  * **no_subtree_check** - If a subdirectory of a filesystem is exported, but the whole filesystem isn't then whenever a NFS request arrives, the server must check not only that the accessed file is in the appropriate filesystem (which is easy) but also that it is in the exported tree (which is harder). This check is called the subtree_check. 
 +  * **async** - This option allows the NFS server to violate the NFS protocol and reply to requests before any changes made by that request have been committed to stable storage (e.g. disc drive). 
 +  * **all_squash** - Map all uids and gids to the anonymous user. Useful for NFS-exported public FTP directories, news spool directories, etc. The opposite option is no_all_squash, which is the default setting. 
 +
 +On client ''/etc/fstab'':
 +  * ''homeserver:/srv/downloads /srv/downloads nfs4 _netdev,x-systemd.after=network-online.target,x-systemd.device-timeout=0,noatime,nodiratime,nfsvers=4.2 0 0''
 +
  
 ===== diagnostic ===== ===== diagnostic =====
Line 28: Line 48:
     * ''5.10.140-1''     * ''5.10.140-1''
     * ''cat /proc/sys/sunrpc/nfs_debug'' **0xFFFF**     * ''cat /proc/sys/sunrpc/nfs_debug'' **0xFFFF**
 +
 +Reason - debug enabled:
 +<code bash>
 +rpcdebug -m nfs -s all
 +</code>
 +
 +Disable it:
 +<code bash>
 +rpcdebug -m nfs -c all
 +</code>