-1

I have a NFS server hooked up to a client over a wireless network (n-router, b/g-client). I have terribly slow transfer rates of around 1.00 to 1.50 MB/s. I cannot seem to figure out how to improve this.

I have played around with rsize/wsize but it doesn't seem to make a difference. My exports on the server is the following:

cat /etc/exports
<SERVER-DIR> *(rw,async,no_subtree_check)

On the client side I see this:

cat /proc/mounts
<SERVER-IP>:<SERVER-DIR> <CLIENT-DIR> nfs4 rw,relatime,vers=4.0,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=<CLIENT-IP>,local_lock=none,addr=<SERVER-IP> 0 0

Shouldn't be able to achieve up to 6-times higher transfer rates?

For comparison: Wired (100Mb/s):

dd if=/dev/zero of=test bs=1M count=128
134217728 bytes (134 MB) copied, 18.5636 s, 7.2 MB/s

Wireless:

dd if=/dev/zero of=test bs=1M count=128
134217728 bytes (134 MB) copied, 99.4493 s, 1.3 MB/s
Markus
  • 200
  • 1
  • 2
  • 13
  • 2
    What is the network latency between client and server? Have you tried this over a wired connection? How do you know it's the Wifi that is causing the problem? – EEAA Feb 12 '14 at 01:12
  • Added wired vs. wireless tests. Running `ping` returns in about 0.75ms. – Markus Feb 12 '14 at 01:26
  • What's the signal strength and contention on the Wifi ? – Lawrence Feb 12 '14 at 01:28
  • I think the signal strength is unlikely an issue since I am about 3ft from the router. – Markus Feb 12 '14 at 01:30
  • @EEAA your initial answer was a bit condescending in my opinion... – Markus Feb 12 '14 at 01:43
  • Not condescending, just the truth. There's not much actually working in your favor with your setup. – EEAA Feb 12 '14 at 01:44
  • Are both the server and the client wireless? Because 1.25 MB/s is the average transfer rate for wireless-to-wireless with 802.11g. – David Schwartz Feb 12 '14 at 07:18

1 Answers1

10

NFS. Over wireless. Using a b/g client (are you even sure you're linked up a G rates?).

You're going to have a bad time here.

Even if you're linked up at the theoretical maximum for 802.11g (54Mbps), and there is no RF interference (very unlikely in the 2.4GHz band), you still have a theoretical max of about 6.75MBps. Count in protocol overhead, retransmits at several levels of the stack, and network latency, you should be happy with what you're getting now.


Honestly, NFS is a very touchy protocol. It doesn't do well with the lossy, up-and-down nature of wireless connections. At the very best, you'll have poor performance. With a typical wireless connection, you'll have atrocious performance, corrupted files, hung mounts, and perhaps worse.

If you need to access storage over wifi, use a different protocol that is a bit more resilient to network issues. CIFS, AFS, Samba, etc. will all do much better than NFS.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • 1
    @Markus - This was not the answer you wanted to hear. I know. Downvote if you like. That doesn't change the facts that you have a hard (perhaps impossible) road ahead of you if you're hoping to get any more performance out of your current setup. – EEAA Feb 12 '14 at 01:39
  • 1
    Wrong, CIFS/SAMBA will give you half the speed.... and is probably the worst way to go. This is usually suggested by windows users that dont know what they are talking about. Its easy just do a side by side test of them both. – ChangosMuertos Apr 23 '14 at 01:50
  • 3
    @ChangosMuertos - There's much more to this than pure speed. I am *not* a windows user. I am very much a linux admin. If you need evidence, look at my [tags](http://serverfault.com/users/20815/eeaa?tab=tags&sort=votes) and see which tags (linux or windows) I have more answers for. That said, regardless of platform, I know a bad architectural decision when I see one, and running NFS over wifi is a perfect example of something that **will** be painful, **will** cause downtime, and **will likely** cause data loss. – EEAA Apr 23 '14 at 02:46
  • @ChangosMuertos - you know what's funny? This answer has gained two upvotes (+20) since your comment and downvote (-1). :) – EEAA Apr 23 '14 at 03:45
  • I wouldn't expect corrupted files, at least on any modern client (which should default to hard mounts and tcp). – Bruce Fields Mar 18 '16 at 21:12
  • Thanks for the answer, on a Synology Nas, NFS was not reliable, but using a cifs works like a charm. – Jérôme B Dec 11 '20 at 22:58