Prevent requesting all subfolders with sshfs

I'm mounting a folder using sshfs -o ro -d user@remote:/home/user/folder /home/myuser/local_folder. I can see that there are LOOKUP requests being issued for every subfolder of the folder I am mounting. Is there some way to prevent these requests from being made? My remote folder has 100k+ subfolders. These LOOKUPs look like so:

unique: 512, opcode: LOOKUP (1), nodeid: 1, insize: 98, pid: 3039
LOOKUP /subfolder_name
getattr /subfolder_name
   NODEID: 226
   unique: 512, success, outsize: 144

I'm on Ubuntu 18.04


Solution 1:

There are a couple of options outlined in the documentation that you'll want to play with to determine the best mix for your use case, but I would suggest looking at these first:

-o no_readahead
   synchronous reads (no speculative readahead)

-o cache=BOOL
   enable caching {yes,no} (default: yes)

If the files on the sshfs mount are being accessed directly as opposed to opening a Terminal (or file manager) and moving between directories, then you can probably get away with disabling both of these options. If the directories need to be listed regularly, then disabling the cache will result in a very sluggish interaction with the remote file system.