How to make Gentoo's CVS access suck less ...

by R CARDONA Email

This post started out as a major rant against CVS and how it sucks to be using it from Europe and how all those round trips in the protocol make even just bumping a single ebuild a tedious task that I have never been able to do in under 4~5 minutes.

But no! I shall not lower myself to this level and instead write a praise for the OpenSSH folks who through their l33t coding skills give us the opportunity to improve CVS for free :D

The problem : the CVS protocol sucks because for each file/directory you want to update, CVS will open a new SSH connection to send its command. The SSH protocol does not really help with that since creating a new connection brings a lot of overhead.

The solution : use the OpenSSH ControlMaster option to tell it to use a single connection that stays open (somewhat like Keep-alive in HTTP) and that will be used to create new "sub-connections" that are much cheaper.

"How?" you ask me. Well, here's how.

  1. Add this to your ~/.ssh/config

    Host *
    ControlMaster auto
    ControlPath ~/.ssh/master-%r@%h:%p

  2. After running ssh-agent, run the following command :

    ssh -M -N -f login@cvs.gentoo.org

  3. Enjoy a 3x speed-up like I did! For those that doubt it, here's how I measured

    cd gentoo-x86/profiles
    find &> /dev/null
    time cvs up -dP
    ssh -M -N -f login@cvs.gentoo.org
    time cvs up -dP

I'd like to give a big "Thank You" to Robin who suggested I try those steps and helped me set them up. Here's to hoping it helps other fellow devs ;)

References

Trackback address for this post

Trackback URL (right click and copy shortcut/link location)

1 comment

Comment from: Markus Ullmann [Member]
Can we get that added to our docs as the speedup is just awesome
10/11/07 @ 11:09

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)