Author Topic: NFS vs SMB vs FTP vs SSH speed test results  (Read 118475 times)

March 19, 2010, 05:52:14 PM
Read 118475 times

choekstr

  • Sr. Member

  • Offline
  • ****

  • 269
I recently decided to try to get my high bitrate files to stop stuttering, something many people are perpetually searching to accomplish.  3 wifi dongles later I realized I was only going to get so much transfer rate using 802.11N at the distance the client is from the Access Point.  One of the issues is we default to using SMB aka CIFS aka Windows file sharing for convenience.  It really is just an inefficient protocol.  

The connected rate I am seeing at distance is 135Mb/s out of a theoretical max of 300Mb/s.  here is what iwconfig shows:
Code: [Select]
ra0       RT2870 Wireless  ESSID:"PimpLair_N"  Nickname:"RT2870STA"
          Mode:Managed  Frequency:5.26GHz  Access Point: 00:1E:E5:9D:71:1A  
          Bit Rate=135Mb/s  
          RTS thr:off   Fragment thr:off

So using my fastest adapter I wanted to start tweaking the settings test the various protocols that mount would support and find the best transfer speeds I could find.  Since I couldn't find iperf compiled for the WDTV Live, I wrote a bandwidth test script to repeatedly transfer a file and show the average bitrate.  The test methodology is transfer a file 10 times, calculate the transfer speed for each pass, and then calculate the average transfer rate for 10 times.  Then do the 10 pass test once again to re-validate the results.  I was shocked at the speed differences the choice in protocol makes!

NFS is by far the fastest at ~73Mb/sec!



Then comes FTP protocol using FTPfs mounting:



Almost but not quite last is our beloved/hated SMB using SMBfs:



And slowest of all is the SSH method using SSHfs (cpu limited):



Because NFS was so radically higher (I expected around 30% faster) I re-ran the NFS test at the end and came up with the same results:



Now realize the bitrates of movies vary from around 1Mb/sec for low-end SD content, to around 4-8Mb/sec for 720p movies.  It gets interesting when you start ripping BluRay movies at 1080p.  Most of the files you encounter and download on the Internet at 1080p are up to 12Mb/sec.  When people archive their own Rips it isn't uncommon to see bitrates as high as 20-45Mb/sec.  This is why many people have a hard time transferring large 1080p movies over wireless.  The bitrates just aren't there to transfer that much content!

I can safely say that my largest movie is a self rip of Twilight at 30.880Mb/sec (finally checked instead of guessing) and weighing in at a whopping 27GB filesize and I could never transfer it without it stuttering at some point.  I finally got NFS working properly and now it is as smooth as butter.  a 30.880Mb/sec movie hardly taxes my wifi card using NFS at 73Mb/sec.  Take that massive movies!

So if you are struggling with transfer rates and always wondered if switching to a different protocol would help, here is a pretty good test that will help determine if it will.  NOTE:  Mounting a SMB share via net.mounts or manually using xmounts WILL NOT do anything for speed over what the built-in automatic method you use in the OSD.

Enjoy and discuss.

P.S.: detailed methodology, scripts, and wifi cards used were left out of this write-up for brevity sake but if you care, just ask.
EDIT:
2010.03.19 bandwidth_test script is now attached to post.


EDIT:
2011.08.30 bandwidth_test script re-attached to post as the forum somehow lost it. Remove .txt and leave .sh extension
« Last Edit: August 30, 2011, 03:21:35 PM by choekstr »
--
Chris

March 19, 2010, 06:01:29 PM
Reply #1

b-rad.cc

  • Hero Member

  • Offline
  • *****

  • 833
  • Personal Text
    FW Hacker
    • B-RAD
i'd love to include this script in wdlxtv :)

i won't be releasing tonight due to missing deadline--aka going out of town now and not done--so I'll get iperf in there too for you in next release ;) (def by sunday)

March 19, 2010, 06:07:25 PM
Reply #2

choekstr

  • Sr. Member

  • Offline
  • ****

  • 269
Let me "un-choekstr" it a bit so it is more generic and then you can add it in and beef it up if you want.  Give me a few mins to tweak and I will attach to the main post.

EDIT: Script attached to orig post.
I would love to have iperf if you have the time to cross-compile it.  I haven't taken the time to setup a compiling environment and so if you don't mind that would be great.

I would also like to keep a chart on the wiki of adapters and what rates they get for each protocol.  We have that a bit for the 1st gen adapters but nothing for the 2nd gen or Live. 
« Last Edit: March 19, 2010, 06:28:56 PM by choekstr »
--
Chris

March 20, 2010, 12:21:52 PM
Reply #3

geordi

  • Newbie

  • Offline
  • *

  • 31
Hi

One stupid question ... if I have Win7 64Bit i need an addon to have the possibility to share attached storage via NFS, correct?

Can to the WD attached storage shared via NFS so that my PC can access it via NFS? Or is only Samba possible?

Regards,
geordi

March 20, 2010, 01:02:09 PM
Reply #4

Padavan

  • Newbie

  • Offline
  • *

  • 15
choekstr
to all

I confirm this fact.

My config:
- WDTV Gen2 with WDLXTV_G2-0.4.1.9 fw (more thanks for brad-cc).
- WiFi USB adapter D-LINK DWA-140 Rev.B1 (based on ralink 2870). 
- WiFi access point based on D-LINK DIR-655 router (802.11n, frequency 2.4 GHz, bandwidth 40MHz, WPA2PSK+AES).

In the connection status, raw speed established on 240...300 mbps.

I use test mkv and m2ts files with H.264 HD 1080p.

If use mount SMB share (aka CIFS), max real speed near 35 mbps. 
Casino.21.mkv - passed
Casino.32.mkv - passed
Casino.40.mkv - stuttering

All BD-remux (from 25 to 50 mbs) play with stuttering.

If use mount NFS share (I use haneWIN NFS server for Windows), max real speed near 95 mbps!!! 
All BD-remux (from 25 to 50 mbs) playing perfect!
Very hard test bird90.m2ts (90mbps) playing perfect!
Only bird90.mkv has stuttering.

ONLY NFS FOREVER!

March 20, 2010, 05:51:09 PM
Reply #5

choekstr

  • Sr. Member

  • Offline
  • ****

  • 269
@Padavan:  Nice that you can confirm and it shows that the raw speed connected DOES have an impact on the speed of transfer.  I have been thinking about maybe a chart of adapters, raw speed they connect, and the actual throughput of each of the protocols.  This would be a nice chart for a newbie to pick his adapter and protocol.  I have heard of maximum of 110-120 with a 300Mbps connected device!  You are pretty close to this...

@geordi: there is no built-in way for Win7 to do NFS.  You can buy 3rd party programs but NFS is a Unix/Linux thing and has been around for decades.  We all know it is a very efficient protocol and it is nice when we see numbers to support it.  Actually it isn't that it is super fast, it is just efficient so it uses as much of the bandwidth it possibly can.  Contrast this with SMB/CIFS from Microsoft where it is a bloated and convoluted protocol that cripples network transports.  With Vista and Win7 they seem to have broken it again and it is just barely back to where it was on Win98 and WinXP!

Some NAS's have NFS built-in along with SMB.  If there is a choice you should choose NFS and use xmount.  Realize the built-in GUI in the WD TV Live is only going to connect to windows and NAS shares on SMB so you can't use it this way.  You would use xmounts in a net.mounts file and then access that share in the "Local Drives" section.  I have switched over to this permanently now and even RW/FF updates the keyframes faster and more often!
--
Chris

March 20, 2010, 06:53:37 PM
Reply #6

oogabooga

  • Newbie

  • Offline
  • *

  • 10
Hi choekstr,

Thanks so much!  Exactly what I was looking for :)

Now only if there was a way to NFS mount an HFS+ formatted drive :(

Sam

March 20, 2010, 09:02:00 PM
Reply #7

choekstr

  • Sr. Member

  • Offline
  • ****

  • 269
NFS is a network transport method.
HFS is a filesystem type.

You would use NFS or SMB or FTP or SFTP or SSH to transfer the files from an HFS drive.  I am pretty sure any OSX machine can mount an HFS+ drive and share it out over NFS. 
http://wiki.wdlxtv.com/Sharing_from_OSX
--
Chris

March 22, 2010, 07:13:49 PM
Reply #8

oogabooga

  • Newbie

  • Offline
  • *

  • 10
I'm trying to go the other way - have my WDTV mount my HFS-formatted Drobo and then serve that via NFS to my laptop for when I need to xfer files to Drobo. 

Doesn't seem to work with the NFS implementation in WDTV (or a number of Linux distros, FWIR).

March 22, 2010, 07:36:26 PM
Reply #9

larsar4

  • Newbie

  • Offline
  • *

  • 32
@padavan or anyone else that would help :-)

I was trying to setup nfs for my windows 7 setup.  Could you tell me how you setup your haneWIN server and how you used the xmount command on the wdtv?

Thanks!

March 22, 2010, 07:43:53 PM
Reply #10

choekstr

  • Sr. Member

  • Offline
  • ****

  • 269
That doesn't seem right.  I have nothing to test this on but a quick search shows several people getting HFS drives to mount and any directory on the WD could be shared out via NFS.  What you want to do is theoretically possible with the firmware as it currently stands.  I can't help you with what it takes to make it happen but in principle it isn't that hard.  

Now digging into more about this Drobo thing, it sounds like a dud when it came out but fine, I won't judge.  Engadget review states "Data rates are acceptable -- we averaged 12-15MBps write throughput during large file transfers. Drobo promised "mid-range" performance, and that's what it delivers."  That equates to 96-120Mb/sec so you should have decent performance.  FWIW, modern drives push 120-150MBps and raided drives are even more.  The drobo brings it down to 1/10th the speed of the drive itself but then again USB 2.0 and all.  But I digress.

So you have USB attached storage, which should present as a mass storage drive, which the WD should mount.  Does it?  The HFS or NTFS partition shouldn't be seen by the OS.  Or does it?  Maybe that is where the problem lies is that their implementation of HFS is non-standard?  But wait, one review said none of their software is needed and Windows can interface directly with the Drobo.  Does that mean it can read HFS drives or just NTFS and OSX is able to deal with the HFS.

Really I am just thinking out loud and asking mostly rhetorical questions here.
--
Chris

March 22, 2010, 07:47:24 PM
Reply #11

oogabooga

  • Newbie

  • Offline
  • *

  • 10
Hey Chris,

Thanks for the comments/thoughts.  I will try a non-Drobo HFS drive tomorrow and see if I can NFS connect to it.  My only successes so far have been with NTFS-formatted drives. 

Cheers,
Sam

March 22, 2010, 07:49:44 PM
Reply #12

choekstr

  • Sr. Member

  • Offline
  • ****

  • 269
@padavan or anyone else that would help :-)

I was trying to setup nfs for my windows 7 setup.  Could you tell me how you setup your haneWIN server and how you used the xmount command on the wdtv?

Thanks!

I watched a surprisingly competent video on this two days ago.  It is for xtreamer player but it shows you how to do the hanewin nfs server side.
Configuring Windows 7 as NFS Server for XTreamer

For the xmounts side that is easy:
xmount IP_ADDRESS:NFS_Share Mount_point nfs

so something like this:
Code: [Select]
xmount 10.0.1.2:/ftp/pub/Video Video_NFS nfs You can test interactively (telnet/ssh) to make sure it is working as you desire before you put it in the net.mounts file.
--
Chris

March 22, 2010, 08:48:55 PM
Reply #13

larsar4

  • Newbie

  • Offline
  • *

  • 32
@choekstr

wow thanks for the help however I'm still without nfs so far

this is how I've setup hanewin

G:\Download\Movies -public -readonly -name:tvshows

this is what I'm getting though:
Code: [Select]
# xmount 192.168.1.136:/tvshows tvshows_NFS nfs
mount: RPC: Timed out

any ideas?

March 22, 2010, 08:50:17 PM
Reply #14

b-rad.cc

  • Hero Member

  • Offline
  • *****

  • 833
  • Personal Text
    FW Hacker
    • B-RAD
you could try -o nolock

portmap not running gives an error like that.