{"thread":{"id":"27833","subject":"How to limit bandwidth used by git over SSH ?","startedAt":"2011-07-17T10:22:47Z","lastAt":"2011-07-20T20:20:26Z","messageCount":4,"participants":["Ralph Seichter","Carlos Martín Nieto","Andreas Krey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"171496","messageId":"4E22B7F7.4020701@seichter.de","threadId":"27833","inReplyTo":null,"subject":"How to limit bandwidth used by git over SSH ?","fromName":"Ralph Seichter","fromEmail":"git-ml@seichter.de","sentAt":"2011-07-17T10:22:47Z","receivedAt":"2011-07-17T10:22:47Z","isPatch":false,"sender":{"key":"git-ml@seichter.de","avatar":null},"body":"Hello list,\n\nI'm not really sure if this is a git or SSH issue, but I haven't figured\nout a solution yet. To transfer my data between two machines, I use\n\n  git-push ssh://machineB.tld/foo/proj.git master\n\nfrom machineA. Unfortunately, the machines are connected by a very low-\nbandwidth connection, which is completely choked by git-push. From what\nI've read so far, I guess this is the result of SSH setting TOS to\n\"minimize delay\", which prevents almost all other traffic during the\npush operation. Not good.\n\nI haven't yet found a way of telling git (or SSH) to use no more than a\ngiven maximum bandwidth, like I could do with \"scp -l {limit}\". Did I\nmiss something in the documentation?\n\nYour help is appreciated.\n\n-Ralph\n"},{"id":"171645","messageId":"1311064940.3945.11.camel@bee.lab.cmartin.tk","threadId":"27833","inReplyTo":"4E22B7F7.4020701@seichter.de","subject":"Re: How to limit bandwidth used by git over SSH ?","fromName":"Carlos Martín Nieto","fromEmail":"cmn@elego.de","sentAt":"2011-07-19T08:42:20Z","receivedAt":"2011-07-19T08:42:20Z","isPatch":false,"sender":{"key":"cmn@elego.de","avatar":"https://avatars.githubusercontent.com/u/335443?v=4"},"body":"On Sun, 2011-07-17 at 12:22 +0200, Ralph Seichter wrote:\n> Hello list,\n> \n> I'm not really sure if this is a git or SSH issue, but I haven't figured\n> out a solution yet. To transfer my data between two machines, I use\n> \n>   git-push ssh://machineB.tld/foo/proj.git master\n> \n> from machineA. Unfortunately, the machines are connected by a very low-\n> bandwidth connection, which is completely choked by git-push. From what\n> I've read so far, I guess this is the result of SSH setting TOS to\n> \"minimize delay\", which prevents almost all other traffic during the\n> push operation. Not good.\n\nA bit OT, but the situation where a link is chocked by a slow uplink\ngetting filled is most likely due to buffer bloat on your modem/router\nwhich confuses TCP's congestion detection by buffering your packets too\naggressively. But that's neither here nor there, I just wanted to point\nout it's not all ssh or git's fault.\n\n> \n> I haven't yet found a way of telling git (or SSH) to use no more than a\n> given maximum bandwidth, like I could do with \"scp -l {limit}\". Did I\n> miss something in the documentation?\n\nBut coming back to SSH, scp knows it's going to do a file transfer, but\ngit uses the ssh client to do a \"normal\" connection to a remote machine,\nto ssh, it's no different from a user typing really fast, which is\nprobably why it's not supported out of the box.\n\nThere is a tool called trickle which takes over the network functions\nand can be used to limit upload and download speeds, so using it like\n\n    trickle -u 20 git push ssh://machineB.tld/foo/proj.git master\n\nshould do the trick.\n\nCheers,\n   cmn\n\n"},{"id":"171744","messageId":"4E272A20.8080904@seichter.de","threadId":"27833","inReplyTo":"1311064940.3945.11.camel@bee.lab.cmartin.tk","subject":"Re: How to limit bandwidth used by git over SSH ?","fromName":"Ralph Seichter","fromEmail":"git-ml@seichter.de","sentAt":"2011-07-20T19:18:56Z","receivedAt":"2011-07-20T19:18:56Z","isPatch":false,"sender":{"key":"git-ml@seichter.de","avatar":null},"body":"On 19.07.11 10:42, Carlos Martín Nieto wrote:\n\n> There is a tool called trickle which takes over the network functions\n> and can be used to limit upload and download speeds [...]\n\nThanks for the hint, Carlos. I tried to compile trickle on OS X 10.6.8,\nbut without success. AFAIK, trickle has not been tested with OS X, and I\nam not even sure it trickle could work at all. Members of the MacPorts\nmailing list seem to confirm my suspicion. I've tried to contact the\nauthor of trickle; hopefully he will reply.\n\nThe general idea to use a tool besides git or SSH to shape the bandwidth\nusage seems valid, though.\n\n-Ralph\n"},{"id":"171745","messageId":"20110720202026.GA30927@inner.h.iocl.org","threadId":"27833","inReplyTo":"4E272A20.8080904@seichter.de","subject":"Re: How to limit bandwidth used by git over SSH ?","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2011-07-20T20:20:26Z","receivedAt":"2011-07-20T20:20:26Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Wed, 20 Jul 2011 21:18:56 +0000, Ralph Seichter wrote:\n...\n> The general idea to use a tool besides git or SSH to shape the bandwidth\n> usage seems valid, though.\n\nThere are ways to integrate such a tool easier than the way trickle\ndoes; by using the 'ProxyCommand' configuration option of ssh, like\n'ProxyCommand netcat $yourhost 22' or similar. Unfortunately, I don't\nknow a suitable program offhand, netcat does not seem to have a bandwidth\nlimiting option. But then such a beast is relatively easy to write.\n\nAndreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"}]}