Skip to content

Scp transfer is slow #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
manu-st opened this issue Jun 17, 2016 · 3 comments
Closed

Scp transfer is slow #21

manu-st opened this issue Jun 17, 2016 · 3 comments

Comments

@manu-st
Copy link

manu-st commented Jun 17, 2016

I've been experimenting with the scp implementation and it is slower compared to the command line tool scp. In my test, it is 5s to copy several files with scp, and 33s with SSH.NET. I noticed that most of the time, it was stuck in a Thread.Sleep (100) in ScpClient.ReadByte, so I changed this to Thread.Sleep(0) and it went down to 15s.

I initially reported this on the old codeplex site and as recommended I'm now filling an issue on GitHub.

This is not blocking as I can use sftp instead which is faster.

Thanks!

@drieseng drieseng changed the title Slow scp transfert Scp transfer is slow Jun 25, 2016
drieseng added a commit that referenced this issue Jun 25, 2016
@drieseng
Copy link
Member

@manu-silicon I just released version 2016.0.0-beta2 of SSH.NET. Can you confirm SCP performance has improved with that release ? Thanks!

@drieseng drieseng added this to the 2016.0.0-beta2 milestone Jun 25, 2016
@manu-st
Copy link
Author

manu-st commented Jun 26, 2016

@drieseng Just tried the new version, while it is faster than before (about 7s), it is still slower than the sftp version (2s). Thanks!

@mtorres0612
Copy link

@drieseng Thanks for your contribution on this!

I have a concern though. Connection alone to my dev server averages for about 12 seconds. Is there any way to make it faster?

Piece of code below, for your reference:

private void Connect()
{
bool success = true; try { this.client = new SftpClient("xxx.xxx.xxx.xx", "username", "password"); this.client.Connect();//THIS PART TAKES ABOUT 12 SECONDS ON AN AVERAGE } catch (Exception ex) { success = false; ErrorMessage = "SFTP-Connect()|" + ex.Message.ToString(); }
}

I'm currently using Parallelism in my console app (Parallel.Foreach, Task.Factory.StartNew) for faster processing, for it reads several files from an SFTP path. But the connection part kills me.

Appreciate your prompt help, I'm currently applying this on my SFTP-related project.

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants