Is NFS the best option to stream videos from QNAP to Pi (Kodi)?

  • Is there a better option to stream videos from a QNAP TVS-872X-I5-32GB to a Pi 4B 8GB (LibreElec 10/Kodi) than add source NFS?

    I was doing some testing last night and I'm not sure if I'm getting peak performance.


    Viewing a 4K movie (6GB file):

    Using a local USB HDD (3TB 7200rpm drive), when I jump forward 40min after starting the movie it takes 15 seconds to catch up.

    Using NFS from the QNAP (2x 12TB, 4TB media volume, 7200rpm drive in Raid 1, low sync priority), when I jump forward 40min after starting the movie it takes 22 seconds to catch up.

    Using SMB from the QNAP(7200rpm drive in Raid 1, low sync priority), when I jump forward 40min after starting the movie it takes 33 seconds to catch up.

    So NFS is faster than SMB. But is NFS running at peak performance because it's taking 22 seconds vs 15 seconds from a local USB HDD.

    I have a 1Gbps network, all hardwired.

    Also, there is only that 1 movie file on the 12TB Raid 1 while I'm testing, no other files.

    My drives have a performance test of 230MB/s, when I jump 40min I can see the network adapter send rate in QNAP Resource Monitor jumps to 95MB/s until it catches up and then drops low when it starts playing again, so I don't think I'm maxing my drives out.

    1 Gbps network looks like it should be able to handle 125MB/s, so it looks like I'm missing about 25% of my speed if I go by the network adapter info in QNAP.

    When I copied the movie file from the Pi (USB HDD) to the NAS (NFS), Kodi showed a write speed of about 40-60MB/s in the top corner, so way below what a 1Gbps networks should be able to do.

    I haven't tried playing the movie yet to see if there's shuttering or pausing, it was late last night when I got it setup and ran these tests.

    Dose that sound like NFS is slower than it should be?

  • When I copied the movie file from the Pi (USB HDD) to the NAS (NFS), Kodi showed a write speed of about 40-60MB/s in the top corner, so way below what a 1Gbps networks should be able to do.

    Write speeds of SDcards and USB sticks are often not that great, compared to read speeds. 40-60MB/s is quite good though.

    NFS in general should be a little bit faster as there is less overhead in its file protocol. But things can vary per situation, so use SMB or NFS, whichever comes out best for you.

    The ports on the RPi4 also do not reach PC speeds. Both USB3.0 and Gigabit ports have approx half the advertised speeds.

    As your as using a QNAP NAS, this is FYI: https://www.bleepingcomputer.com/news/security/…ices-worldwide/

  • > Using a local USB HDD (3TB 7200rpm drive), when I jump forward 40min after starting the movie it takes 15 seconds to catch up.

    What is the format of the file? For indexed files like mkv, I'd expect this to be much faster.

    I typically seek around files with a 1 or 2 second delay (Pi4 using nfs, but I'd expect directly attached disk to typically be better than any network interface).

    Non-indexed files (m2ts, dvd/bluray iso or folder structure) can be a lot slower to seek.

  • I think as popcornmix suggested you might want to look at your media files and make sure everything is OK there, most of my media is MKV and seeking is pretty much instant.

    Maybe test your network speed with iperf3 at various points to your QNAP. Might be your read/write size needs to be adjusted, or mount options.

    95MB/s, that's pretty respectable. If you have some other network usage/congestion, your pretty much within the upper limit of Gigabit around 800Mbit/s. The other thing to consider is bus limitations, CPU usage, etc within the receiving device as well.

    Some simple testing with non-cached files below, but this is between 2 AMD64 boxes (Ryzen 5 & FX 8350).

    Over NFS:

    dd if=/srv/media/movies/X2\ \(2003\)/X2\ \(2003\)\ 720p\ AAC.mp4 of=/dev/null bs=8192

    326423+1 records in

    326423+1 records out

    2674058398 bytes (2.7 GB, 2.5 GiB) copied, 24.7901 s, 108 MB/s

    Local:

    dd if=/srv/media/movies/X-Men\ Origins\ -\ Wolverine\ \(2009\)/X-Men\ Origins\ -\ Wolverine\ \(2009\)\ 720p\ AAC.mp4 of=/dev/null bs=8192

    263663+1 records in

    263663+1 records out

    2159933396 bytes (2.2 GB, 2.0 GiB) copied, 8.29314 s, 260 MB/s

    Iperf3 (suggests there is little NFS overhead @ ~112MB/s -- but you still have Ethernet/IP/TCP overhead)

    Connecting to host 192.168.0.10, port 5201

    Reverse mode, remote host 192.168.0.10 is sending

    [ 5] local 192.168.0.1 port 43988 connected to 192.168.0.10 port 5201

    [ ID] Interval Transfer Bitrate

    [ 5] 0.00-1.00 sec 112 MBytes 942 Mbits/sec

    [ 5] 1.00-2.00 sec 112 MBytes 941 Mbits/sec

    [ 5] 2.00-3.00 sec 112 MBytes 941 Mbits/sec

    [ 5] 3.00-4.00 sec 112 MBytes 941 Mbits/sec

    [ 5] 4.00-5.00 sec 112 MBytes 941 Mbits/sec

    [ 5] 5.00-6.00 sec 112 MBytes 941 Mbits/sec

    [ 5] 6.00-7.00 sec 112 MBytes 941 Mbits/sec

    [ 5] 7.00-8.00 sec 112 MBytes 941 Mbits/sec

    [ 5] 8.00-9.00 sec 112 MBytes 941 Mbits/sec

    [ 5] 9.00-10.00 sec 112 MBytes 942 Mbits/sec

    - - - - - - - - - - - - - - - - - - - - - - - - -

    [ ID] Interval Transfer Bitrate Retr

    [ 5] 0.00-10.00 sec 1.10 GBytes 942 Mbits/sec 0 sender

    [ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver

  • Write speeds of SDcards and USB sticks are often not that great, compared to read speeds. 40-60MB/s is quite good though.

    NFS in general should be a little bit faster as there is less overhead in its file protocol. But things can vary per situation, so use SMB or NFS, whichever comes out best for you.

    The ports on the RPi4 also do not reach PC speeds. Both USB3.0 and Gigabit ports have approx half the advertised speeds.

    As your as using a QNAP NAS, this is FYI: https://www.bleepingcomputer.com/news/security/…ices-worldwide/

    I just started the copy for my full 2TB movie library from the Pi USB HDD to the NAS and it's copying at 45 MB/s. So that's good then?

    Thanks for the heads upon Qlocker.

  • > Using a local USB HDD (3TB 7200rpm drive), when I jump forward 40min after starting the movie it takes 15 seconds to catch up.

    What is the format of the file? For indexed files like mkv, I'd expect this to be much faster.

    I typically seek around files with a 1 or 2 second delay (Pi4 using nfs, but I'd expect directly attached disk to typically be better than any network interface).

    Non-indexed files (m2ts, dvd/bluray iso or folder structure) can be a lot slower to seek.

    The file is mkv. If I only just 30 seconds, 1min, 2min, it's pretty instant. The larger the jump the higher the lag, so I was just using 40min jumps because that's easy to see. Are you saying your MKVs if you were to do a 40min jump it's only like a 1-2 second delay?

    Is there a way to index the files with QNAP and Pi/Kodi? (Sorry if that's a dumb question, setting this up is new to me).


    Indeed, it's more like 90MB/s in reality.

    Okay, so when see it spike to 95MB/s read when I jump 40min ahead in the movie that's good then? The difference between the NAS and a directly attached USB HDD is just network loss, nothing I can do for that?

  • Thanks for the suggestion, I'll look into that. This is new to me so I'll have to figure that out.

    Are you saying when you do a 40min jump ahead in an MKV video it instantly starts playing? 1min,2min jumps are instant for me but the future out I go the longer the lag to get playing again.

  • Are you saying when you do a 40min jump ahead in an MKV video it instantly starts playing?

    Yeah, it's maybe a 250ms delay, but it's pretty instant. For example, a 27GB HEVC 4k video, seeking an hour into it, no problem maybe 250ms. This is from an RPi4, connected over Wi-Fi, to NFS on my Ubuntu AMD FX8350 box. I am using a NFS source in Kodi 19.

  • Yeah, it's maybe a 250ms delay, but it's pretty instant. For example, a 27GB HEVC 4k video, seeking an hour into it, no problem maybe 250ms. This is from an RPi4, connected over Wi-Fi, to NFS on my Ubuntu AMD FX8350 box. I am using a NFS source in Kodi 19.

    oh wow, I want that :)