Samba vs. NFS: Performance

11

4

I've got a choice of setting up Samba or NFS on my Linux based NAS ( nslu2 running OpenDebian ).

  1. Does anyone have performance related stories comparing the two options ? Are there tuneup tricks that improve transfer speeds for one or the other ?
  2. What options do I have in terms of toolkits/test suites to gather performance metrics on my setup ?

The nslu2 isn't the most powerful NAS ( 266Mhz ARM processor, 32 MB RAM ) so the overhead of running the Samba or NFS daemon is a factor too. Also, I'm looking at this purely from a performance standpoint, i.e. security issues surrounding NFS aren't my concern.

user4358

Posted 2009-08-05T22:37:21.980

Reputation:

Question was closed 2020-01-26T19:56:04.437

Answers

10

Hello fellow NSLU2 user. I would definitely go for NFS, unless there were some compelling reasons (namely Windows machines). NFS is more light-weight and faster.

As for the NSLU2 side, you will find that tweaking the NFS options and choosing the right filesystem for the shared disk are important. I have chosen ext3 but then switched to ext2 as it seemed to consume less of the precious resources. When using wireless don't expect extraordinary performance and don't use too big block size, otherwise go for huge blocks.

In either case there are some parameters to tweak. Do some benchmarks on your own and decide which options are the best (TCP/UDP, rsize, wsize, etc) for example for NFS here is some old comparison: NSLU2 NFS

Last but not least - it would be nice to see your results - to learn from them ;)

Anonymous

Posted 2009-08-05T22:37:21.980

Reputation: 231

3

The main benefit I can think of to use SAMBA is that is supports SMB file shares to windows boxes. If you want to connect to this with only a another unix box, then NFS will likely perform better.

Axxmasterr

Posted 2009-08-05T22:37:21.980

Reputation: 7 584

I need to mount the external drives on both Linux and Mac. Mac doesn't automount NFS shares ( unlike Samba shares ) but I'm willing to spend time to get the NFS shares on the Mac if it gives me that little extra in performance. – None – 2009-08-05T22:48:58.583

http://mactechnotes.blogspot.com/2005/08/mac-os-x-as-nfs-client_31.html Try this page. It has examples that should work with your mac. – Axxmasterr – 2009-08-05T23:01:18.523

I actually got it to work using these instructions: http://nedos.net/2007/11/10/nfs-in-mac-os-105-leopard/ . Mounting NFS is a lot simpler in Leopard than previous versions.

– None – 2009-08-10T10:47:53.047

3

NFS isn't great but Samba will definitely be slower, the only advantage is to allow Windows clients. Unless Windows machines are an issue go with NFS.

Robert Swisher

Posted 2009-08-05T22:37:21.980

Reputation: 314

You're wrong. Actually, I'm using CIFS between Linux boxes only for the speed. – demonkoryu – 2013-04-19T11:17:21.073

3

I don't have the numbers anymore, but NFS trounced Samba in performance when I did my big head to head comparison/benchmarking series. And on high speed and/or high latency links, using NFS over TCP outperformed NFS over UDP. Apparently at some point windowing becomes more important than simple packets.

Brian Knoblauch

Posted 2009-08-05T22:37:21.980

Reputation: 4 313

2

Go with NFS - if you are using Vista or 7 Clients install Services for Unix and you'll be able to access NFS exports via Windows machines using microsofts NFS clients.

Nick

Posted 2009-08-05T22:37:21.980

Reputation: