Speed difference between Plink and Openssh

Asked

Viewed 200 times

8

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

In Linux everything worked very well, but in Windows programmers began to complain of slowness. Using a colleague’s machine to Troubleshooting (Windows 7 + Mercurial 3.8.4) I realized that actually even cloning relatively small repositories takes quite a while:

$ 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 a few tips (as such), tried to enable compression in the TortoisePlink. I also tried to use a beta version of Plink (theoretically faster) with little or no difference.

I then installed the 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 on Linux, but 15 seconds is an acceptable time.

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

I believe that OpenSSH is an acceptable solution since the target audience is developers. That said the Windows people are not very used to the Linux world and the integration of TortoiseHG + Plink + Pageant ends up being far less alien than Cygwin + OpenSSH + ssh-agent. Is there any other good performance and usability option for Windows?

3 answers

2

  • It’s Marcos. Official Microsoft support will be beautiful. I played a game with Openssh at Powershell at home yesterday and the whole part of ssh-agent worked well. For the TortoiseHg everything became transparent (the ssh-agent registered as service lifts keys). In terms of performance, at the moment Cygwin is a little faster (but that shouldn’t be true for long)... I’ll see if I can get this to run on Windows 7 (my colleague couldn’t).

  • I was thinking about a crazy idea here. Have you tried installing Linux in Virtualbox, and running Tortoisehg there? Would the performance be better?

  • Hello Marcos, out of curiosity I took the test. Operations like clone has performance very close to the original Linux environment (they are faster than Cygwin). That said, the work of putting a VM to run, configuring shared folders, etc makes the Cygwin a more viable option. No other native alternative (so far found nothing) I think the best option is to initialize the ssh-agent as service and add the key in the startup. I even found a script for that reason.

  • 1

    I understand, it’s not practical. But if you start using intermediate repositories, like Repodraft -> Repopublic -> Repocanonico, it might be interesting. Repodraft would be in Windows in the draft phase, the audience would be in its Virtualbox/Linux, and the canonical is the external server. With Windows communicating via HTTP with Linux, being an internal virtual network, it would be safe. Linux would continue to connect to the external server using SSH. To complete, Linux could be on the USB stick, and Virtualbox could start directly from there, facilitating mobility between computers.

1


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

A lot has changed in the meantime, including, Windows 10 is getting a native version of Openssh. Nothing more than the Win32-Openssh mentioned in response of Marcos Zolnowski which can now be installed as a optional functionality of Windows.

WSL also works well, although it is not a substitute for a native client (integration with programs outside the WSL still leaves something to be desired).

To performance Mercurial on Windows is not yet on par with Linux. On Linux on average cloning via SSH is usually much faster than via HTTPS. That being said, all the SSH clients I tested are being able to clone medium-sized repositories (50 - 100 MB) in a matter of seconds and not minutes. Honestly I haven’t used Cygwin for much anymore (and that’s great).

Follow some times with 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)

0

  • Hi Vitor, yeah, I saw that the Git people in Windows also suffers both with the difference in the file system and with versions lagged / slow ssh clients. Unfortunately because it is Media in fairly small repositories I am hostage to the speed of the ssh client (that is the bottleneck already made clear to me). Is there any kind of configuration that can be fair to increase performance?

  • I don’t know if your repository does, but Voce could try cloning the repository and working via http. Github for example allows cloning at http.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.