Why very slow / no directory caching with SSHFS?

Solution 1:

What system are you on? What versions of sshfs and fuse are you running? I'm on ubuntu server 18.04 and using authorized keys for auth.

This my fstab:

sshfs#user@server:/var/path/  /home/user/path  fuse defaults,allow_other,uid=111,gid=115,noauto 0   0

and versions:

fuse             2.9.7-1ubuntu1  amd64    
libfuse2:amd64   2.9.7-1ubuntu1  amd64
sshfs            2.8-1           amd64

Here's some output from timing ls -l

$ time ls -l | wc -l
1259

real    0m0.160s
user    0m0.010s
sys     0m0.012s

A remote directory with 1259 files or folders listed pretty quickly.

I don't know if it may make a difference or not but I also have:

UseDNS no

In my /etc/ssh/sshd_config file. It speeds up initial logins