I set up my raspberry with osmc as a nfs server some time ago, but I don’t usually copy large files so was OK.
However these days I am trying to transfer some videos, and is taking forever just to copy 200 mb file.
I am sharing a HDD connected by USB, and my raspberry its connected using Ethernet. Filesystem is ext4
My PC where I have my videos its on Wifi
My export file on raspi its this /mnt/media 192.168.0.150/255.255.255.0(rw,sync,no_subtree_check)
On my pc, I am mounting from fstab with this config: 192.168.0.150:/mnt/media /mnt/nfs/raspi nfs nolock,rsize=16384,wsize=16384,intr,noatime,rw 0 0
I feel that problem its on my Laptop, as everytime I try to copy a file progress bar quickly advance to 90/98 % and stuck there. If I wait enough it finish. Read seems to work OK, I can play same video with any problem.
I already played a lot with these configs with no results and I am getting a bit crazy. So, any idea?
Some tests/logs already made:
osmc@osmc:~$ iperf -c 192.168.0.150 -r
Server listening on TCP port 5001
TCP window size: 128 KByte (default)
Client connecting to 192.168.0.150, TCP port 5001
TCP window size: 2.50 MByte (default)
[ 5] local 192.168.0.150 port 34568 connected with 192.168.0.150 port 5001
[ 4] local 192.168.0.150 port 5001 connected with 192.168.0.150 port 34568
[ ID] Interval Transfer Bandwidth
[ 5] 0.0-10.0 sec 5.54 GBytes 4.76 Gbits/sec
[ 4] 0.0-10.0 sec 5.54 GBytes 4.75 Gbits/sec
If the pi is a pi3 or older , then USB2 may be the bottle neck. May be quicker to move the external drive to the device you are copying from, then move it back.
You’re using the sync option, so the server will only confirm the write operation once it has been written to disk. With a rotating disk, that can take a significant amount of time.
Using async should improve performance, though with the slight risk of data corruption during writes, for example as a result of a power outage.
+1 for async.
Also, on the client use tcp and remove the size stuff which just prevents a modern NFS server/client from negotiating the best sizes. My client options:
proto=tcp,intr,rw,_netdev,async,soft
soft should help performance. tcp should prevent packet fails.