Saturday, January 29, 2011

Good NFS configuration for Small Network (NFS Performance Issues)

I have a small LAN that has a couple of Linux boxes (Ubuntu 9.10) with NFS shares on them. The boxes are networked with a consumer grade Netgear router (model WGR614V9) and using wired connections.

When I first set up the NFS shares, I noticed that performance was pretty terrible. For example, it would take a few minutes to copy 40 mbs worth data from a mounted NFS share to local disk.

By playing around with the NFS configuration, I was able to get things running reasonably well. The configuration I settled on for the system exporting the share was:

# /etc/exports On the machine exporting the NFS share:
/exprt/dir client.ip (rw,async,no_root_squash,no_subtree_check)

For the NFS client, I have

# /etc/fstab
server.ip:/exprt/dir on /imprt/dir type nfs (rw,noatime,rsize=32768,wsize=32768,timeo=14,intr)

However, while this seems to work reasonably well for me, it still seems to be faster to copy files from one system to the other using scp than it is using NFS.

I thought it would be worth asking what NFS configurations other people might be using on similar network set ups that results in reasonably good performance. I know NFS can be pretty sensitive to things like choice of OS and precise network configuration. But, I suspect the set up I have is pretty common amount other users with small local networks, so it would be useful to hear what configuration works best for them.

Note: I originally asked this question on superuser. But, I got no replies so I suspect it might have been the wrong forum for this type of question.

  • It's pretty standard for scp to be quicker than NFS; there's a lot more overhead and things that need doing for a network filesystem than for a simple machine-to-machine transfer.

    Scott Alan Miller : SCP should not be faster at all. SCP has ongoing encryption that takes resources. SCP might have compression turned on, though, which could make a difference if there is enough horsepower. Here is a comparison of throughput from different technologies: http://forums.neurostechnology.com/index.php?topic=9263.0
    From womble
  • I normally just use SMB and have fine connections. I would like to point you to this site, just incase you have not looked it over.

    http://nfs.sourceforge.net/nfs-howto/ar01s05.html

    wazoox : NFS gives higher thruput overall; very fast CIFS clients achieve 70MB/s, while fast NFS achieves 120 MB/s (full gigEth bandwidth).
    From Justin S
  • I use rsize=8192,wsize=8192 here, and I have no complaints about performance. I haven't measured it, though.

    From Teddy
  • NFS should give you about 50% of the underlying disk write performance. If your disk does 100MB/s, then you should be able to do 50MB/s NFS write.

    About the mount options : use tcp. udp can give pretty bad results.

    sebthebert : Where did you get this number of 50% ? Benchmark you've done ? Benchmark you read on Web ?
    wazoox : That's what I regularly get on all the systems I build (several hundreds so far :)
    wazoox : Actually I've been quite pessimistic; You _can_ get 90% of the disk throughput through NFS, but I usually test systems with very fast RAID arrays that easily saturate their network interfaces.
    From wazoox

0 comments:

Post a Comment