MacOS sshfs: improving Finder performance

I’ve been using sshfs to access a Linux volume about 30ms away from where I am. I don’t expect this to be lightning-fast, but Finder was acting very slowly. Like 10 seconds to open $HOME, a directory with 143 files in it. Every directory took a few seconds the first time it was opened in Finder, even though network traffic was tiny. Presumably lots of little synchronous reads.

Long story short, the solution is:

-o noappledouble,noapplexattr

Using this in OSXFUSE sshfs is a lot faster. Maybe 2 seconds for that Finder window, not 10. The key feature is “noappledouble”. This tells sshfs to completely deny all access to any ._ and .DS_Store files. Not only does that keep this garbage out of your Linux filesystem, it avoids lots of network round trips as Finder tries to open them. (Not sure why a client cache doesn’t fix that, but oh well.) That option can cause Mac system calls to fail, and while I’m not certain I think the noapplexattr may help with that.

The advice to use these options is scattered all over the net, most of it seems to be a cargo cult inspired by this 2008 post. I did not find good docs for what we should be doing here in 2015, the best I could find are these old docs for MacFUSE which at least explain what the options do. I’m too lazy to read the source.


2 thoughts on “MacOS sshfs: improving Finder performance

  1. I just put it in an alias I use to invoke sshfs. If you mount via /etc/fstab you could put the option there. Definitely wouldn’t go in .ssh/config, and I don’t know that OSXFUSE has any config files

Comments are closed.