Score:0

Prevent requesting all subfolders with sshfs

tr flag

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

Score:1
in flag

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.

max1e6 avatar
tr flag
I tried setting `-o no_readahead -o cache=no` but it is still sending LOOKUP for every subfolder. The only way I am accessing the files is with something like `ls /home/myuser/local_folder/subfolder/file_name`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.