Boosting NFS speed

So basically I’ve tried rsize and wsize at 16384. Doesn’t seem to change much. I’ve changed between soft and intr,timeo with no real difference. I’ve even tried to switch in my modem to channel 13 on my wifi (authorised here) but OSMC or the integrated chipset doesn’t even see the wifi. The other channels are packed with people…

TL;DR : Still no perfect solution. Should I try another value than 16384 for wsize and rsize or just some crazy magic tweak solution not tried yet ?

Thanks everyone anyways for the help!

Hi th0m,

I am using the following settings on my RPi 2: /mnt/osmc-movies/ nfs x-systemd.automount,_netdev,nfsvers=3,ro,intr,noatime,rsize=32768,wsize=32768,nolock,async,proto=udp 0 0

In your line, you force the protocol to run over TCP, what is potentially a bit slower than using UDP (proto=udp). In @flori4n’s line protocol is omitted, but if I recall it, it defaults to UDP. My buffers are a bit bigger, but that may not have as much difference as the UDP protocol choice (at some point buffer sizes are not improving too much, maybe 16k/32k are already in that range). Also, @flori4n’s line is asking for nfs v4, what my server is not supporting (or maybe at that time RPi was not supporting), but could be potentially a plus to have. Since I don’t care for write access on the RPi side, my line also have ‘ro’ (read only). I am not sure whether ‘async’ may help or not. So using settings from @flori4n and my lines should get you close to the best NFS settings. If that doesn’t fix all your problems, you will need to also start looking into your WiFi setup.

As far as WiFi, if you don’t live in an apartment, and don’t have much interference, then WiFi channel selection may not do anything for you. If you do, instead of guessing a channel number, you would need to use some app to see which channels are less busy (less routers are using them). (Netgear has a nice Android app for that.) However, if you could get to a 5GHz range, your speed may be better (usually less crowded, but in a single home may not have the reach). However, if I recall it right, RPi USB implementation may not be giving you the full USB2 speed, so switching from 2.4 to 5GHz may not really improve it that much.

With all that said, my setup is over the Ethernet cable, and if I recall it, it gives me ~10-12mbps max speed what potentially is max what you get over the Ethernet on RPi 2. As you can see, that is well below 100mbps Ethernet speed, and well below any decent WiFi router.


1 Like

@jacek Thanks so much for that very complete answer, I will give it a try.

I do live in an apartment and I use a Wifi analyser app to find the best channel (which would be 13 but its not seen by the pi3) . However my wifi gives me a 8Mbps according to iperf. This should read most of the file I am trying to. I guess tweaking NFS could help me. I will definetly try a new line with your comments in mind!

Thanks !

@th0m You welcome. Happy that can help a little. Although, I made a big mistake above. The speed that I am getting is ~12MBps (mega bytes), so actually close to the max what 100Tx Ethernet can give (so further tweaking will not improve much anymore). You can run the following command:

dd if=/mnt/movies/test.file of=/dev/null
9841113+1 records in
9841113+1 records out
5038650339 bytes (5.0 GB) copied, 421.202 s, 12.0 MB/s

This way, you can point to one of your videos (test.file in this case), and see how fast it goes over the protocol you are using at the moment. This test should give you about the same results as Kodi should see. Of course, just moving that file takes a bit of CPU time.


Just so you know, you’ll only get reliable streaming over Ethernet. You can try all you like but you’ll not get it working especially in a block of apartments

I’d love to be more positive but you’ll not succeed without upgrading to faster wireless or using Ethernet.

You may achieve momentary success but as soon as the bitrate increases you’ll run into issues again.

However when you do achieve success let us know.

I do totally agree with you. It is clearly the main issue. However, I rent the place I cannot run Ethernet cable through any walls… I still find the challenge interesting. The higher the bitrate I can have over Wifi the happier I’ll be. I do not seek perfection at all. However, when I test with iperf between the server and the pi3 , I clearly get a network speed that sould be enough for the files I am trying to watch. So there seems to be room for improvement for either samba or nfs shares and I’ll keep trying, researching the internet, and testing any advice that might be given on this topic.

To keep updated: UDP seems really not to like Wifi , I switched back to TCP. Wsize 16k or 32k doesn’t seem to make any difference.
And most surprisingly, after a few days of using both, it seems that Samba gives a more reliable, more stable stream.

Take a look:

Be wary of the marketing, the advertised speed is the “data rate” between the devices including all error correction and compression algorithms so throughput is roughly 10% (from experience.

Getting a 500Mbps set should do you go for HD. But the faster the better.

Unfortunately, I agree with martin_l. If you live in a block of apartments, you’re going to be suffering from lots of interference from your neighbours’ networks.

At home, I have my Internet connection through my office, and my living room (with pretty much all media devices in the TV stand connected to Internet) is connected to the office (where my server is located) through Homeplugs/PowerLAN and a switch. I still suffer from interferences on this, mind you, so I only get 112Mbps tops between the rooms when conditions are ideal, but it often falls below 50Mbps if lots of electric/electronic devices are stitched on (it’s a very old block of flats, so the electric installation is much older than I am). That should still be more than enough for most cases, but I do get break-ups and buffering with very high bitrate HD files (I think I start to get issues from about 3GB per hour (e.g. I’ll get some buffering if a 2h video file is bigger than 6GB) - That’s my rule of thumb in my particular case, anyway).

As far as PowerLAN goes, I’d recommend to use passthrough adapters (i.e. the PowerLAN adapter has a male power outlet, so that you can connect something else on top of it), because they filter the immediate interference generated by the electrical devices behind it:

Note that my setup is a bad example because I still use the power outlet right beside my PowerLAN adapter… But I believe this is still much better than using a regular adapter on a multiplug, as seen on the picture in Martin’s post.

From what I’ve read about PowerLAN vs WiFi in the past, it could very well make a huge difference for you.

I think that it is good to differentiate between noise and noise suppression when dealing with devices like HomePlugs. Those devices are designed to deal to some extent with noise; however, may not do that well with noise suppression that most multiplugs / power extension cords have. With that in mind, you should rather never plug those devices to any multiplugs, etc. unless you know for sure that those are just pure straight copper wires.

I would also argue that using WiFi dongles with external antennas with USB cables may solve some issues, and be less expensive from those HomePlug ones. Of course, if there is a driver for it. For example something like this:

Thanks to both of you for the advice, I will look into those solutions. Anyways, this thread is still about finding the best protocole and options to share content over wifi. I’m sure other have tried and I cannot be the only one wanting to fine tune the best I can anything I get my hands on when it comes to the RaspPi. However, still an somewhat unrelated question: does my iperf results look normal to you ?

osmc@osmc:~$ iperf -c -r
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)

Client connecting to, TCP port 5001
TCP window size: 43.8 KByte (default)

[ 5] local port 55174 connected with port 5001
[ ID] Interval Transfer Bandwidth
[ 5] 0.0-10.0 sec 37.4 MBytes 31.2 Mbits/sec
[ 4] local port 5001 connected with port 40696
[ 4] 0.0-11.1 sec 11.0 MBytes 8.29 Mbits/sec

I used this topic and everything works fine for me now.

1 Like

I give up.

You’ll only ever achieve temporary success via wifi as there are TOO MANY VARIABLES for you to be able to prove whether a minor protocol tweak has made a difference.

Your neighbour may turn on their microwave, used a dect phone, got a baby monitor, got a router with auto wireless channel changing, got incorrectly earthed devices spewing out interference?

With it being so impossible to determine what’s happening within your local environment you’ll never know whether or not your protocol tweaks made a difference.

Your persistence in asking for resource in resolving this issue is frustrating, but I admire it on some level.

As I said, I give up, good luck, please reply when you figure this out, maybe keep it to yourself and present it to Cisco or Netgear so they can pay you royalties.

Please do not take it personally. Everything you said has been more than welcome. I will seriously consider HomePlug. I understand that Wifi is never gonna be a viable solution. And I hadn’t even thought of half the variable you just mentioned. However, some do get their content over Wifi flawlessly, and I do get mine to any other device in the room flawlessly. I am just trying not to give up on that too easily. I still keep an open mind though and will more than likely end up abandoning the idea of sharing content via Wifi.

THIS is a breakthrough !!! I changed to my country’s settings, not only can I see channel 13 now but the best is that my iperf results DOUBLED. This is plain and simply incredible. I will do some content streaming test but man that was helpful!

1 Like

Ok a little follow-up on this matter. The integrated rpi3 wifi is a mess. But I think I am starting to get it figured out.

1st step , I set the region for the wifi using this link : Raspberry Pi 3 with OSMC unable to use wifi channels 11,12,13 in UK - #6 by lyonacre
This improved max speed. And allowed me to try less crowded channels.

2nd step, I used sudo iwconfig wlan0 power off and it made it more stable. Using this thread : Pi 3 WiFi unstable - #7 by sam_nazarko

Lastly, I have changed advancedsettings.xml as advised on Kodi Wiki for 1GB of ram devices. Here:

As of now, everything looks finally smooth. But I will report on that after a few days of testing.

Turning off power management on the internal adapter will do nothing because power management is already disabled for this adapter.

Doing iwconfig was giving me a “power management : on” status. And I could swear it got better, but it might be an error.

Power management is not properly reported from the driver due to the way it has been patched.

Well I give up. Even if I got things way better than when I started, there is no real, stable solution. I’ve tried anything and I still have some caching, stuttering from time to time while I successfully stream content to so many different other devices over Wifi. Thus, I cannot find any other explanation: the integrated Wifi on the pi 3 is rubbish! Is it hardware related ? Or could a better driver get better results some time in the future ?

Mind you, for people who would wind up on this topic looking for tips on how to improve their video streaming from a share I can give some advice as a summary of my many attempts:

  1. mount your share at os level (fstab), know that the default options are just great, you will not gain much by tweaking it. NFS is considered better, Samba is working nearly as well.

  2. Force caching , adjust the cache and readbuffer factor on your advancedsetting (see Kodi Wiki for that)

  3. If you’re trying to get it to work via WiFi, know that a crowded channel will impact greatly the streaming performance and that Ethernet will always give you better results. If you’re trying to use channel 13 and it does not appear see a few post above.

I finally bought an external USB WIFI dongle and the problem is resolved. Pi3 integrated wifi is just not good enough (and 2,4Ghz channel are overcrowded to say the least in my area).

Thanks to everyone that has tried to find the best solution with me !

1 Like