2

I am using SSHFS to transfer files under Linux between my notebook and my desktop machine. It's easier then NFS because one doesn't have to configure mount points and permissions a priori.

Now, using SSHFS is slower than I would expect from a 100MBit Ethernet connection (sadly, the notebook has no Gigabit Ethernet). I get about 10MiB/sec, instead of 12.5MiB/sec. Can the overhead of protocols "steel" the "rest" (which would be 2.5MiB/sec)?

Switching from IPv4 to IPv6 didn't improved the speed. Using -C for compression made the process even slower.

SSHFS allows to pass parameters to underlying SSH (using -o SSHOPT=VAL). Well, there are a lot of SSH parameters there.
From experience, which of these parameters could improve speed of an SSHFS connection?

womble
  • 96,255
  • 29
  • 175
  • 230
java.is.for.desktop
  • 929
  • 3
  • 9
  • 15

5 Answers5

9

You're getting about 80 Mb/s out of your 100 Mb/s link. That's pretty close to the theoretical limit of the link (you'll rarely get anything like the nominal link speed) and is an entirely reasonable figure to achieve.

Beyond that, on top of the overheads of running an encrypted tunnel (SSH) you've also got the TCP overheads, and any other traffic using the connection. I'd say that practically speaking you're unlikely to achieve any better throughput without changing to a protocol with a lower overhead.

Cry Havok
  • 1,845
  • 13
  • 10
4
sshfs -o Ciphers=arcfour,Compression=no,auto_cache

compression slows on pack/unpack

arcfour is blazing fast !!!WHILE!!!! not 100% safe. LAN ONLY

auto_cache allows you to store file localy in temp somewhere so its not accessed via network second time.

with this 1GB connection to server is twice as fast for me.

deil
  • 41
  • 1
  • 1
    For those finding this answer years after it was written : arcfour is not supported anymore by Openssh since its version 7.6 (2017-10-03) https://www.openssh.com/releasenotes.html#7.6 – Httqm May 11 '20 at 15:01
3

you can "limit" the encryption Overhead by using "arcfour" as cipher. The SSH option is "-c arcfour"

Tim Haegele
  • 951
  • 6
  • 13
1

The fact that compression slowed down the transfer could indicate a high processor usage.

What are the respecting configurations and processor usage when transferring using sshfs ?

regarding the fact that you use a 100Mb/s lan, you can test your speed with other protocols/overhead, like FTP.

Iperf can also be used in that case to test the bandwidth, disregarding any disk slowdowns.

petrus
  • 5,297
  • 26
  • 42
  • 1
    Thanks for the hint! `iperf` test resulted in about 95MBit for both IPv4 and IPv6. So, I guess, I'm not loosing too much bandwidth with SSHFS, when even "plain" TCP is slower than nominal. – java.is.for.desktop Sep 19 '10 at 22:19
0

SSHFS works over SSH. One of the key things in regards to SSH performance is the cipher algorithm you use to encrypt the data. SSH developers constantly add new algorithms to enforce security and deprecate old ones which are usually lighter.

Depending on the SSH versions on each end you might be able to use some old lighter algorithm like arcfour or blowfish by setting it in the SSHFS options or in the /etc/ssh/ssh_config file.

You can check the available algorithms using the ssh client binary on both ends.

[root@backup]# ssh -Q cipher
3des-cbc
blowfish-cbc
cast128-cbc
arcfour
arcfour128
arcfour256
aes128-cbc
aes192-cbc
aes256-cbc
rijndael-cbc@lysator.liu.se
aes128-ctr
aes192-ctr
aes256-ctr
aes128-gcm@openssh.com
aes256-gcm@openssh.com
chacha20-poly1305@openssh.com

If arcfour and/ or blowfish aren't available (the most probable thing as per 2023), you can use chacha20-poly1305@openssh.com, which is a very light yet fast cipher.

Another important parameter that affects performance is compression. Depending on your CPU it might be faster to disable it as in the example below.

compression=yes|no

Caching (user space and kernel) could help, but not for new data. Use caching carefully, it could end up returning outdated data.

cache=yes,kernel_cache

The easiest way to test is by including the options in the very mount command.

sshfs -o Ciphers=chacha20-poly1305@openssh.com,compression=no,reconnect,cache=yes,kernel_cache,ThreadCount=2 you@server.com:~/ /mnt/sshfs 

On top of the above you can also enable Jumbo Frames in your network, which would help to improve speed transfering big files. You can read on how to set Jumbo Frames up in Windows and Linux here:

https://33hops.com/vmware-esxi-enable-jumbo-frames-increase-mtu.html

Daniel J.
  • 214
  • 1
  • 5