Mercurial and Bazaar SSH Speed

Martin Geisler mg at aragost.com
Thu Sep 30 11:36:54 BST 2010


John Arbash Meinel <john at arbash-meinel.com> writes:

> On 9/29/2010 8:21 PM, Martin Pool wrote:
>> Both these lists now have a policy against cross-posting, because it
>> tends to degenerate into noise, but I'm letting the first post through
>> for the record.
>> 
>> As I understand it, it turns out that the server here is very
>> cpu-constrained compared to a typical modern pc.  Neither hg nor bzr
>> is really tuned for that case.  Because bzr can operate pretty well
>> across sftp it did much better here.
>> 
>
> I would actually guess that this is 'dumb transport' support at work.
> IIRC Mercurial has an ssh mode that doesn't require hg to be installed
> on the other end, but invokes stuff like 'cat' and 'ls'. (I could be
> completely wrong.)

Yeah, I'm afraid we don't have such a plain-SSH support. We always
require a real hg on the other end of a SSH tunnel.

The only dumb transport we support is read-only HTTP (we call it
static-http). That is what lets you put a .hg folder on any HTTP server
and do 'hg clone' and 'hg pull' against it.

> The main thing I noticed was the:
>
> Cygwin Hg Cygwin-SSH:       7m 11s      14m 3s
> Cygwin Hg Compressed-SSH:   5m 37s      5m 25s
>
> Which leads me to believe that Hg isn't compressing content
> over-the-wire which is having a dramatic effect based on bandwidth.

Correct, for SSH, Mercurial will not compress the traffic. The idea is
that SSH can do it better because it has the whole stream to work on.

I think it's a bit unfortunate that we don't default to 'ssh -C',
perhaps we should change that.

> IIRC, the hg smart protocol un-zlibs the local content, and then
> bzip2's the network stream. So I would expect compressing the ssh data
> wouldn't help if you were using a smart conversation.

We gzip compress the stream for HTTP. The bzip2 compression comes into
play if you are creating a bundle file with 'hg bundle'.

Heh, it's actually pretty confusing with all these compression
schemes... :)

> I would also guess that bzr has had a bit more effort spent at
> dumb-transport performance.
>
> John
> =:->

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/



More information about the bazaar mailing list