NFS performance debug and optimization

26 March 2013

NFS performance debug & optimization

Optimization performance of mounts made with Network Filesystem Server

Debugging NFS mount for the best performance between Debian - Mint machines.

Mount details and statistics each time would be provided.

The Problem

The transfert speed between our development server and my Linux Mint workstation is not stable, and sometimes is very slow.

# dd if=/dev/zero of=/mnt/pcFedir/image.iso bs=16k count=16384
16384+0 records in
16384+0 records out
268435456 bytes (268 MB) copied, 104.974 s, 2.6 MB/s

Why ?

Adjustment client’s side

I’ve tried multiple combinations of mounts and datagramms to improve such low performance.

server:/remotepath    /localpath    nfs defaults,rw 0 0
server:/remotepath    /localpath    nfs rw,intr,hard,nfsvers=3.tcp,nolock,noatime,rsize=32768,wsize=32768 0 0
server:/remotepath    /localpath    nfs rw,hard,intr,rsize=8192,wsize=8192 0 0
server:/remotepath    /localpath    nfs rw,intr,soft,nfsvers=3.tcp,nolock,noatime,rsize=32768,wsize=32768 0 0
server:/remotepath    /localpath    nfs4 rw,intr,hard,noatime,rsize=32768,wsize=32768 0 0

But the difference was not so big, the maximum bandwidth I achieved it was : 16 MB/s

Looking at the server

So the problem was apparently on the server side.

In /etc/exports of NFS server machine, I had :

/somelocalpath clientIp(rw,all_squash,anonuid=someId,anongid=someId,no_subtree_check,sync)

I have changed only one letter :

/somelocalpath clientIp(rw,all_squash,anonuid=someId,anongid=someId,no_subtree_check,async)

Statistics :

# dd if=/dev/zero of=/mnt/pcFedir/image.iso bs=16k count=16384
16384+0 records in
16384+0 records out
268435456 bytes (268 MB) copied, 2.4645 s, 109 MB/s

Number of NFS process

In /etc/default/nfs-kernel-server

Before :

# Number of servers to start up
RPCNFSDCOUNT=8

After :

# Number of servers to start up
RPCNFSDCOUNT=32

Statistics :

# dd if=/dev/zero of=/mnt/pcFedir/image10.iso bs=16k count=16384
16384+0 records in
16384+0 records out
268435456 bytes (268 MB) copied, 2.42922 s, 111 MB/s

The result

It’s not the most secure way, but in my case it’s exactly, what I need. Performance.

It looks Ok now.

References

  • http://nfs.sourceforge.net/nfs-howto/ar01s05.html
  • http://www.tldp.org/LDP/nag2/x-087-2-nfs.mountd.html
  • http://doc.ubuntu-fr.org/nfs
  • http://www.tldp.org/LDP/nag/node142.html
  • http://www.cyberciti.biz/faq/linux-unix-tuning-nfs-server-client-performance/
  • http://www.techrepublic.com/blog/opensource/tuning-nfs-for-better-performance/64
  • http://atmail.com/kb/category/optimization/page/2/
  • https://lists.ubuntu.com/archives/ubuntu-users/2009-June/188420.html
  • http://www.cyberciti.biz/faq/nfs4-server-debian-ubuntu-linux/
  • http://www.tomvernon.co.uk/blog/2011/09/some-nfs-notes/

© 2017 Fedir RYKHTIK