From 40961b10c0bef945cf7f09c947e8bb0c0e950955 Mon Sep 17 00:00:00 2001 From: nevaforget Date: Tue, 14 Apr 2026 11:50:33 +0200 Subject: [PATCH] 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. --- main.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index f260e09..45b07b0 100644 --- a/main.go +++ b/main.go @@ -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()