Add SSHFS performance options

Replace minimal mount flags (dir_cache=no) with aggressive caching
and connection tuning: kernel_cache, attr/entry/negative timeouts,
fast cipher (aes128-gcm), reconnect with keepalive.
This commit is contained in:
nevaforget 2026-04-14 11:50:33 +02:00
parent 962ef84675
commit 40961b10c0

15
main.go
View File

@ -75,7 +75,20 @@ func verify_mount_dir(hostname string)(mount string) {
}
func mount_sshfs(hostname string, user string, ifile string, port string, mount string) {
cmd := exec.Command("sshfs", "-p", port, "-o", "IdentityFile="+ifile+",idmap=user,dir_cache=no", user+"@"+hostname+":/", mount)
cmd := exec.Command("sshfs", "-p", port,
"-o", "IdentityFile="+ifile,
"-o", "idmap=user",
"-o", "cache=yes",
"-o", "kernel_cache",
"-o", "attr_timeout=60",
"-o", "entry_timeout=60",
"-o", "negative_timeout=20",
"-o", "Ciphers=aes128-gcm@openssh.com",
"-o", "Compression=no",
"-o", "reconnect",
"-o", "ServerAliveInterval=15",
"-o", "ServerAliveCountMax=3",
user+"@"+hostname+":/", mount)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()