Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Improve NFS client performance Network
I have all my iTunes data on a linux NFS server, which I had previously used with a Windows box via Samba. The new iMac uses NFS to access the same data store. I found changing ID3 tags to be very, very slow compared to the Windows box. It turns out that write performance seriously lagged. smb_fs mounts performed well, but could not be automounted, so I ended up tuning the NFS settings.

The critical factor that affected performance was the number of nfsiod threads. Adding more threads means that more simultaneous NFS operations can occur at once (including read-ahead and write-behind operations). To increase this value, simply edit the file /System -> Library -> StartupItems -> NFS -> NFS, and change the line that reads:

  nfsiod -n 4
Replace the 4 with 8 or more, followed by rebooting or manually killing and re-running nfsiod. You will notice an increase in throughput when writing large files. To test the speed, run the following command before and after the change:
  time dd if=/dev/zero of=/mnt/home/testfile bs=16k count=16384
Going from 4 to 8 nfsiod threads resulted in write speeds going from 700k/sec to over 3.2mb/sec! Further tuning can be found by reading the Linux NFS How-To Performance Section.
    •    
  • Currently 2.40 / 5
  You rated: 3 / 5 (5 votes cast)
 
[46,106 views]  

Improve NFS client performance | 15 comments | Create New Account
Click here to return to the 'Improve NFS client performance' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Improve NFS client performance
Authored by: doggkruse on May 07, '03 02:04:19PM

I have never been able to figure out how to get my Mac to mount a NFS share from my linux box in the first place...



[ Reply to This | # ]
Improve NFS client performance
Authored by: pmlindner on May 07, '03 02:30:31PM

I remember the NextStep days, so mounting nfs volumes is old hat.

Probably the simplest way is to create an fstab file containing the nfs volumes you want to mount:

<pre>
foo.com:/media /Users/lindner/media nfs rw,intr,bg,rsize=16384,wsize=16384 0 0
foo.com:/home/lindner /Users/lindner/stuff nfs rw,intr,bg,rsize=16384,wsize=16384 0 0
</pre>

Then load it into netinfo like so:

<pre>
niload fstab . < /etc/fstab
</pre>

The automounter should pick up on this right away. It mounts things in /private/automount/actual/path/name and creates a symbolic link to the mount point.

Nice part about this is that everything is mounted on first use, no matter who logs in.



[ Reply to This | # ]
Improve NFS client performance
Authored by: joshpearce on May 07, '03 03:17:22PM

Is there more information on this, aimed specifically at sharing
NFS volumes from linux to OSX? These's hints are a little over
my head.



[ Reply to This | # ]
Improve NFS client performance
Authored by: wgscott on May 07, '03 05:32:49PM

You might find NFSmanager to be of help.

http://www.bresink.de/osx/NFSManager.html


It is extremely straightforward using this. It is not at all straightforward without it. The documentation is superb.

It is uncrippled shareware -- ie, pay $15 if you like it and want to. In other words, try it out first.



[ Reply to This | # ]
Improve NFS client performance
Authored by: bluehz on May 09, '03 08:17:26AM

Yeah - me either - I have tried Samba, netatalk, and NFS...
occasionally I can make a connection, but repeating the process
is futile. I can type "scp ....." faster if all I want to do is move
files.

... I would like the ability though.



[ Reply to This | # ]
Improve NFS client performance
Authored by: bluehz on May 09, '03 08:44:28AM

All I ever get when I try to conncet to my Linux Server:

(on the mac)
NFS Portmap: RPC Port Mapper Failure -RPC : Timed Out

I can't tell you how many forums and mailing lists I have posted
that error msg on and no one seems to know what it is. Well
whatever it is - it happens when I try to connect to my Linux
server via NFS and it continues to fill up my logs until I
reboot.



[ Reply to This | # ]
Improve NFS client performance
Authored by: pmlindner on May 13, '03 10:59:30AM
You probably need to enable the 'insecure' option on the server. Here is my /etc/exports file:
/home           68.166.39.0/255.255.255.128(rw,insecure)
/media          68.166.39.0/255.255.255.128(rw,insecure)
/var/www/html   68.166.39.0/255.255.255.128(rw,insecure)


[ Reply to This | # ]
Improve NFS client performance
Authored by: jurvis on Jun 10, '03 02:05:22AM

thank you thank you thank you thank you thank you thank you thank you thank you !!!!! i have been posting everywhere myself on this question. i do happen to have root on the linux server- but what if i hadn't. how do I specify that the automounter should communicate on a "secure" port? just in case...



[ Reply to This | # ]
Improve NFS client performance
Authored by: cytherea on Jul 21, '03 02:07:26AM

pass the -P option to mount, or add it to the opts property of your mount in netinfo.

cheers.



[ Reply to This | # ]
Improve NFS client performance
Authored by: omnivector on May 08, '03 10:55:51AM

If you mount an nfs partition from the finde (Command+K),
such as nfs://myhostname/exportdirectory i thought write access
was not possible? I've tried getting remote writing to work
before and had no luck in OSX through the finder. For example,
if you mount a ftp site where you have write or delete access,
you still can't write or delete. Is that just for FTP?

---
- Tristan



[ Reply to This | # ]
Improve NFS client performance
Authored by: nivekinJPN on May 15, '06 01:23:24PM

To get my export mounted on osX as a writeable volume I had to make sure the uid/gid were the same on MacOSX and FreeBSD.
so my /etc/exports file looks like this:
/AD0 -alldirs -maproot=1001 192.168.0.2

Be careful on FreeBSD. it's different syntax than the linux exports file. the (rw, insecure) doesn't work.
I changed my uid/gid in netinfo manager on mac from 501 to 1001 to macth them on FreeBSD. be careful as you will loose customization of your Desktop and Finder and may have to "chown -R username:groupname /Users/username" after you do that as most of your files /folders in /Users/username will be owned by the previous uid, namely 501 for most default user accounts from original install.




[ Reply to This | # ]
Improve NFS client performance
Authored by: cerbero on May 10, '03 06:15:53AM

I can't get this to work.. No matter what I change the value in the nfsiod file to... I always get around 950-1000kb/s of write speed.
I have the same problem with SMB, which is why I'm trying out NFS now. Thogh with SMB, I can write at full speed to the server, but when I edit id3-tags of songs on it, it's really slow. A solution for that would be nice too if anyone knows, and if it's not too much off-topic :)



[ Reply to This | # ]
Improve NFS client performance
Authored by: pmlindner on May 13, '03 11:04:07AM

Working out network performance bottlenecks can be difficult. You might check if all your machines are using full-duplex connections. Use the nfsstat command to look for excessive retransmissions.



[ Reply to This | # ]
Improve NFS client performance
Authored by: andrewbrydon on Jun 09, '03 02:06:23PM

Started off with reasonable nfs write speeds (2Mb/s) but terrible read speeds (worse; dropping to Finally discovered that killing all my nfsiod processes returned my read speed to normal; with default block sizes (32kb in both directions, nfs version 3) I now get around 4Mb/s in both directions. Not clear whether this is something specific to my setup, or particular server.

The server is a linux box running nfs-kernel-server. The only other box on the network is a linux laptop and sees good performance in both directions.

Hope this helps someone.

[ Reply to This | # ]

async vs. sync
Authored by: pfile on Jan 12, '04 02:44:28AM

I've found that the single most important thing to improve performance is to export the mount on the server with "async". note that the default used to be async on linux until recently, now it defaults to sync.

i'm talking about the difference between ~400KB/sec and 3MB/sec here on large files (30-40MB), over gigabit ethernet. (as a reference this link was able to do 16MB/sec using ftp on large files-- nowhere near gigabit speeds but more than 100mbit ethernet and possibly within reason since OSX does not support jumbo frames)

anyway async can be dangerous if the server crashes as the client is told that writes have been committed before they actually have. however NFSv3 is supposed to have some features that make async mounts "safer", but its unclear whether OSX is actually using these. i suppose if it conforms to the NFSv3 spec then it will...



[ Reply to This | # ]