Speed difference between Plink and OpenSSH

8

I have a setup with some Mercurial repositories. For security and standardization issues recently the https access to the Mercurial repositories were disabled, which forced all developers to use ssh.

In Linux everything worked very well, but in Windows programmers started complaining slowly. Using a colleague's machine for troubleshooting (Windows 7 + Mercurial 3.8.4) I realized that in fact even cloning relatively small repositories takes a long time:

$ time hg clone ssh://[email protected]/meuprojeto
destination directory: meuprojeto
requesting all changes
adding changesets
adding manifests
adding file changes
added 52 changesets with 216 changes to 55 files
updating to branch default
33 files updated, 0 files merged, 0 files removed, 0 files unresolved

real    2m58.229s
user    0m0.000s
sys     0m0.015s

Following some tips ( like esssa ), I tried to enable compression on TortoisePlink . I also tried using a beta version of Plink (theoretically faster) with little or no difference.

I then installed Cygwin with OpenSSH and the difference was brutal:

$ time hg clone ssh://[email protected]/meuprojeto
destination directory: meuprojeto
requesting all changes
adding changesets
adding manifests
adding file changes
added 52 changesets with 216 changes to 55 files
updating to branch default
33 files updated, 0 files merged, 0 files removed, 0 files unresolved

real    0m15.794s
user    0m0.000s
sys     0m0.015s

The clone was ~ 11 times faster! Still 3 times slower than Linux, but 15 seconds is an acceptable time.

I wonder if anyone has any idea what makes OpenSSH so much faster than Plink when we use Mercurial on Windows? Is there anything that can be done to improve the performance of Plink ?

I believe OpenSSH is an acceptable solution since the target audience are developers. That said the Windows staff is not very accustomed to the Linux world and the integration of TortoiseHG + Plink + Pageant turns out to be much less alien than Cygwin + OpenSSH + ssh-agent . Is there any other good good performance and usability option for Windows?

    
asked by anonymous 17.07.2016 / 01:05

3 answers

1

Returning to answer my own question a year and a half later.

Much has changed in the meantime, even Windows 10 is gaining a native version of OpenSSH. Nothing more than the Win32-OpenSSH mentioned in the answer of the Marcos Zolnowski that can now be installed as a optional Windows functionality .

WSL also works well, although it is not a substitute for a native client (integration with external WSL programs still leaves a mark).

The performance of Mercurial on Windows is not yet on an equal footing with Linux. On average Linux cloning via SSH is usually much faster than via HTTPS. That being said all the SSH clients I've tested are managing to clone medium-sized repositories (50-100 MB) in a matter of seconds, not minutes. Honestly I have not used Cygwin for much else (and that's great).

Here are some of the most popular SSH clients on my personal machine ( Mercurial Distributed SCM 4.4.1 + Windows 10 ):

HTTPS

hg clone https://[email protected]/tortoisehg/thg --time
time: real 23.926 secs (user 13.125+0.000 sys 2.891+0.000)

Win32-OpenSSH 0.0.24.0 (OpenSSH_7.6p1, LibreSSL 2.5.3)

  

ssh="C: \ Program Files \ OpenSSH-Win64 \ ssh.exe" -C -a -x

hg clone ssh://[email protected]/tortoisehg/thg --time
time: real 22.402 secs (user 13.203+0.000 sys 2.859+0.000)

WSL openSUSE Leap 42.3 (OpenSSH_7.6p1, OpenSSL 1.0.2n-fips 7 Dec 2017)

  

ssh = ssh -C -a -x

hg clone ssh://[email protected]/tortoisehg/thg --time
time: real 23.990 secs (user 11.940+0.620 sys 4.620+0.760)

Git For Windows 2.15.1.2 (OpenSSH_7.6p1, OpenSSL 1.0.2m 2 Nov 2017)

  

ssh="C: \ Program Files \ Git \ usr \ bin \ ssh.exe" -C -a -x

hg clone ssh://[email protected]/tortoisehg/thg --time
time: real 28.191 secs (user 13.703+0.000 sys 2.734+0.000)

PuTTY (Release 0.70)

  

ssh="C: \ opt \ PuTTY \ PLINK.exe" -ssh -2 -C -a -x

hg clone ssh://[email protected]/tortoisehg/thg --time
time: real 28.630 secs (user 14.281+0.000 sys 2.641+0.000)
    
20.12.2017 / 00:25
2

In the future: Windows Subsystem for Linux

Currently, there do not seem to be many interesting options.

It's a shot in the dark, but you could try using the Win32 OpenSSH .     

21.07.2016 / 20:05
0

There is an article that talks about the slowness of git in Windows: link

One way to solve is with git lfs clone... , see here .

Most of the commands executed in Windows are slow, like git, ruby, python, etc ... Technically, I do not know how to explain the reason, but this is related to OS architecture and kernel. Cygwin emulates Linux.

    
20.07.2016 / 21:53