11

我注意到通过 ssh 克隆 repo 比通过 http 慢得多,无论它来自我自己的服务器还是 BitBucket。在我的情况下,这相当于从 http 到 10 秒,而在同一个 BitBucket 存储库上使用 ssh 则超过2 分钟。

我在 Windows 上使用 Mercurial(TortoiseHg 1.5,Mercurial 1.7)。两个测试都是从 GUI 和 CLI 完成的。

这是一个常见的“问题”还是我做错了什么?

4

2 回答 2

3

您是否在 ssh 客户端中打开了 ssh 压缩?它在 HTTP 中默认开启,但在 ssh 中默认关闭,这是 ssh 而不是 mercurial 控制的设置。

http://confluence.atlassian.com/display/BITBUCKET/Using+SSH+to+Access+your+Bitbucket+Repository#UsingSSHtoAccessyourBitbucketRepository-EnablingCompression

通常,Mercurial ssh 访问比 http 更快——反正对我来说也是如此。

我发现在 LAN 上没有压缩会更快(压缩比 xfer 需要更多时间),而在 WAN 上则相反。

于 2010-11-10T14:54:03.507 回答
2

I have seen the same.

At first, I had a RHEL4/RHEL5 ssh issue, that prohibited compression to be negotiated - but that's fixed now (configuration tweaks). Unfortunately, I still see a factor of ~3 in cloning a repo (http vs. ssh).

I used "ssh = ssh -C -v" to see the compression ratio.

I'm using Linux, and I see this when cloning a large repo (180M+) - over a WAN (Europe <-> India/Asia).

于 2010-11-17T14:28:51.720 回答