{"id":5,"date":"2007-10-11T10:00:39","date_gmt":"2007-10-11T10:00:39","guid":{"rendered":""},"modified":"2022-02-07T09:40:48","modified_gmt":"2022-02-07T08:40:48","slug":"how_to_make_gentoo_s_cvs_access_suck_les","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/remi\/2007\/10\/11\/how_to_make_gentoo_s_cvs_access_suck_les\/","title":{"rendered":"How to make Gentoo&#8217;s CVS access suck less &#8230;"},"content":{"rendered":"<p>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.<\/p>\n<p>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 \ud83d\ude00<\/p>\n<p>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.<\/p>\n<p>The solution : use the OpenSSH <code>ControlMaster<\/code> 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 &#8220;sub-connections&#8221; that are much cheaper.<\/p>\n<p>&#8220;How?&#8221; you ask me. Well, here&#8217;s how.<\/p>\n<ol>\n<li>Add this to your <code>~\/.ssh\/config<\/code><br \/>\n<blockquote><p>Host *<br \/>\nControlMaster auto<br \/>\nControlPath ~\/.ssh\/master-%r@%h:%p<\/p><\/blockquote>\n<\/li>\n<li>After running ssh-agent, run the following command :<br \/>\n<blockquote><p>ssh -M -N -f login@cvs.gentoo.org<\/p><\/blockquote>\n<\/li>\n<li>Enjoy a 3x speed-up like I did! For those that doubt it, here&#8217;s how I measured<br \/>\n<blockquote><p>cd gentoo-x86\/profiles<br \/>\nfind &amp;> \/dev\/null<br \/>\ntime cvs up -dP<br \/>\nssh -M -N -f login@cvs.gentoo.org<br \/>\ntime cvs up -dP<\/p><\/blockquote>\n<\/li>\n<\/ol>\n<p>I&#8217;d like to give a big &#8220;Thank You&#8221; to <a href=\"http:\/\/robbat2.livejournal.com\/\">Robin<\/a> who suggested I try those steps and helped me set them up. Here&#8217;s to hoping it helps other fellow devs \ud83d\ude09<\/p>\n<p>References<\/p>\n<ul>\n<li>http:\/\/www.linux.com\/articles\/54498 for the configuration file<\/li>\n<li>http:\/\/gcc.gnu.org\/wiki\/SSH%20connection%20caching for a simple explanation of the command line options<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/blogs.gentoo.org\/remi\/2007\/10\/11\/how_to_make_gentoo_s_cvs_access_suck_les\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to make Gentoo&#8217;s CVS access suck less &#8230;<\/span><\/a><\/p>\n","protected":false},"author":66,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/posts\/5"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/users\/66"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":1,"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"predecessor-version":[{"id":84,"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/posts\/5\/revisions\/84"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/remi\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}