NFS performance problems

Forum: LinuxTotal Replies: 8
Author Content
Sander_Marechal

Oct 20, 2008
3:13 PM EDT
Hi all,

Does any of you know anything about NFS? I am exporting my media collection from my server to my desktop over NFS, but the performance is awful. Write speed from my desktop to the NFS share is about 246 Kb/s. It's not the network link. iperfs says 948 Mb/s (I have gigabit and cat6). It's also not the hard drives on the server. Write speed according to dd is about 80 Mb/s. Also, transferring the same files over rsync+ssh instead of NFS gives me about 40 Mb/s. A far cry from the ! gig max, but stil much, much faster than NFS.

/etc/exports on the server (Debian Lenny): /var/export 192.168.1.0/24(rw,fsid=0,all_squash,no_subtree_check) /var/export/music 192.168.1.0/24(rw,all_squash,no_subtree_check)

/etc/fstab entry on my desktop (Debian Etch): 192.168.1.5:/var/export/music /var/music nfs rw,_netdev,sync,hard 0 0

Any idea what to test to find the problem? How to fix it?
herzeleid

Oct 20, 2008
3:34 PM EDT
So it sounds like sshfs would be faster than nfs - how odd. Just as an additonal datapoint, you might want to check speeds exporting the same data with samba.

If it's only nfs that is really bad, there are some parameters that can help.

BTW is this the normal kernel-based nfs, or the alternative userspace nfs server?
jdixon

Oct 20, 2008
5:00 PM EDT
You might take a look here: http://tldp.org/HOWTO/NFS-HOWTO/performance.html and see if anything looks obvious. It's probably rather dated, but...
Sander_Marechal

Oct 20, 2008
5:18 PM EDT
@herzeleid: I'm using the normal kernel-based NFS. sshfs is not an option. Besides the fact that it's a FUSE filesystem* I really, really need the all_squash option that NFS provides. Does Samba have something like that?

Besides that, I might try Samba just to test it's speed, but I'm not going to run Windows shares in an all-Linux environment. That would just feel... dirty.

* Many FUSE filesystems lack functions that are very important for media collections, like partial file reads. Imagine trying to read the tags off all your mp3's. That's about 1k per file, tops. With any regular filesystem (and with NFS) you can simply open the file, read the first 1K and parse the tags. So for your 1000 song media collection, you'd transfer 1 MB. With many FUSE filesystems you have to transfer the entire file before you can start reading: 1000 * 8 MB = * GB! Not all FUSE filesystems have this problem, but often FUSE is osed to provide filesystem-like access to things that aren't true filesystems, like an ssh/sftp connection as is the case with sshfs.
techiem2

Oct 20, 2008
6:01 PM EDT
Quoting:Besides that, I might try Samba just to test it's speed, but I'm not going to run Windows shares in an all-Linux environment. That would just feel... dirty.


Not to mention that, in my experience here, when I added my music collection to Songbird in Windows over samba, it couldn't read the ogg tags. But when I installed SFU and connected the Windows box to my server over NFS, it worked fine.

I didn't try Linux->Linux samba though to see if that would read properly.

My major gripe with sshfs is that it doesn't properly report the disk space and such of the remote system (but I understand that's a limitation of ssh). I don't know about full/partial file read though.
gus3

Oct 21, 2008
12:00 AM EDT
Default mount options for NFS include very small read and write sizes. Have you specified "-o rsize=16384,wsize=16384"?
Sander_Marechal

Oct 24, 2008
6:44 PM EDT
@gus3: That didn't help at all. It's still about 246 Kb/s. I also noticed that during the NFS transfer, top says the server load increases from about 0.25 to 0.99. I don't get it. It's not a simple bux. It's a Quad-core AMD64 with 2 GB RAM. It should barely break a sweat.

Any other ideas?
tracyanne

Oct 24, 2008
6:54 PM EDT
I get good network speeds with SaMBa, I actually use it for streaming Movies between my Media machine and my laptop.
Sander_Marechal

Oct 24, 2008
8:56 PM EDT
Ha, I fixed it! Somehow I had "sync" as a mount option (instead of intr which I really meant). Fixing that and I am now at 21 MB/s (186 Mbit/s) using NFS4 :-)

I still think that faster should be possible on a 1000 Mbit/s network though, but at least this is a decent enough speed to work normally.

You cannot post until you login.