git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to limit bandwidth used by git over SSH ?

From
Carlos Martín Nieto <cmn@elego.de>
Date
Jul 19, 2011, 08:42 UTC
Message-ID
<1311064940.3945.11.camel@bee.lab.cmartin.tk>
In-Reply-To
<4E22B7F7.4020701@seichter.de>
On Sun, 2011-07-17 at 12:22 +0200, Ralph Seichter wrote:
Show 12 quoted lines
> Hello list,
> 
> I'm not really sure if this is a git or SSH issue, but I haven't figured
> out a solution yet. To transfer my data between two machines, I use
> 
>   git-push ssh://machineB.tld/foo/proj.git master
> 
> from machineA. Unfortunately, the machines are connected by a very low-
> bandwidth connection, which is completely choked by git-push. From what
> I've read so far, I guess this is the result of SSH setting TOS to
> "minimize delay", which prevents almost all other traffic during the
> push operation. Not good.

A bit OT, but the situation where a link is chocked by a slow uplink getting filled is most likely due to buffer bloat on your modem/router which confuses TCP's congestion detection by buffering your packets too aggressively. But that's neither here nor there, I just wanted to point out it's not all ssh or git's fault.

> 
> I haven't yet found a way of telling git (or SSH) to use no more than a
> given maximum bandwidth, like I could do with "scp -l {limit}". Did I
> miss something in the documentation?

But coming back to SSH, scp knows it's going to do a file transfer, but git uses the ssh client to do a "normal" connection to a remote machine, to ssh, it's no different from a user typing really fast, which is probably why it's not supported out of the box.

There is a tool called trickle which takes over the network functions and can be used to limit upload and download speeds, so using it like

    trickle -u 20 git push ssh://machineB.tld/foo/proj.git master
should do the trick.
Cheers,
   cmn
Previous: Ralph SeichterNext: Ralph Seichter
Message 2 of 4 in “How to limit bandwidth used by git over SSH ?”
  1. Ralph SeichterJul 17, 2011
  2. Carlos Martín NietoJul 19, 2011
  3. Ralph SeichterJul 20, 2011
  4. Andreas KreyJul 20, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.