feo-cz / win-sshfs

Fork of http://code.google.com/p/win-sshfs/
BSD 3-Clause "New" or "Revised" License
1.27k stars 126 forks source link

Very slow performance #46

Open mhall opened 8 years ago

mhall commented 8 years ago

Using Dokan 0.7.4 and have tried win-sshfs release 1.5.12.8 as well as 1.5.12.9-rc1. I am experiencing very poor file copy performance from a mounted sshfs to local disk (max of ~550 kB/s). I have a very high-speed internet connection and no problem with speeds using SFTP standalone (usually get ~10 MB/s). Is this a limitation of the SSH.Net library used here?

hcjehg commented 8 years ago

Same here. But what is worse, I think I experienced errors in file lists. Opening one file but getting the content of another file. When I saw that I immediately changed back to 1.5.12.8 that works perfectly...

Is 1.5.12.-rc1 designed to work with Dokan 0.7.4 or? It seems to mee that there were recently some changes that would break backwards compatibility in Dokan library... :-S

HC

tylergibson commented 8 years ago

Yes, 1.5.12.9 rc1 is specifically designed to work with 0.7.4.

This is a known issue with basically all pure SFTP implementations, SSH.NET included. Since SSH.NET also implements SCP, and SCP uses a different method for file upload/download, that may significantly improve performance. It should just require changing ReadFile and WriteFile in https://github.com/dimov-cz/win-sshfs/blob/devel/Sshfs/Sshfs/SftpFilesystem.cs to use a ScpClient client call instead of the SFTPFileStream.

https://github.com/dimov-cz/win-sshfs/blob/devel/Renci.SshNet/ScpClient.cs

dimov-cz commented 8 years ago

550 is realy slow, i can get more them 3MB/s download from winsshfs over internet. SCP can help with poor latencies connections. In high speed/low latency i will be suprised if SCP will be significant difference. For really highspeed "overSSH" transfers I know only one solution: http://www.psc.edu/index.php/hpn-ssh But this need support/patches on both sides.

marquis-de-muesli commented 8 years ago

One improvement that only needs changes in the sftp client is to use pipelining, which is described in more detail here https://daniel.haxx.se/blog/2010/12/08/making-sftp-transfers-fast/.

Basically instead of waiting for each small packet to be acknowledged before sending the next (which is the real bottleneck in high latency environment) a lot of packets are sent off at once with the sftp client keeping track of their state.

This has already been implemented in libraries like libssh/libssh2 but not in SshNet as far as i can see.