搜尋此網誌

2017年2月25日 星期六

Linux mount NFS Using TCP

The default transport protocol for NFS is UDP; however, the Red Hat Enterprise Linux 3 kernel includes support for NFS over TCP. To use NFS over TCP, include the -o tcp option to mount when mounting the NFS-exported file system on the client system. For example:

mount -o tcp shadowman.example.com:/misc/export /misc/local

If the NFS mount is specified in /etc/fstab:

server:/usr/local/pub    /pub   nfs    rsize=8192,wsize=8192,timeo=14,intr,tcp


If it is specified in an autofs configuration file:

myproject  -rw,soft,intr,rsize=8192,wsize=8192,tcp penguin.example.net:/proj52


Since the default is UDP, if the -o tcp option is not specified, the NFS-exported file system is accessed via UDP.

The advantages of using TCP include the following:


  • Improved connection durability, thus less NFS stale file handles messages.
  • Performance gain on heavily loaded networks because TCP acknowledges every packet, unlike UDP which only acknowledges completion.
  • TCP has better congestion control than UDP (which has none). On a very congested network, UDP packets are the first types of packet that are dropped. Which means if NFS is writing data (in 8K chunks) all of that 8K has to retransmitted. With TCP because of its reliability, one parts of that 8K data is transmitted at a time.
  • Error detection. When a tcp connection breaks (due to the server going down) the client stops sending data and starts the reconnection process. With UDP, since its connection-less, the client continue to pound the network with data until server comes up.


The main disadvantage is that there is a very small performance hit due to the overhead associated with the TCP protocol.


Source:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/System_Administration_Guide/s1-nfs-mount.html



沒有留言:

張貼留言

搜尋此網誌