Live data from Hacker News

Speed Up Git Pull

interrobeng.com

1–10 of 50 posts

Re: Speed Up Git Pull

#3

If you're a heavy SSH user, using multiplexing in this manner can have negative consequences [1]. Downsides include having all your multiplexed connections exiting if the master exits! [1] http://www.anchor.com.au/blog/2010/02/ssh-controlmaster-the-...

You can limit the sharing to just GithHub with a host line:

  Host github.com
  ControlMaster auto
  ControlPath /tmp/%r@%h:%p
  ControlPersist yes

Re: Speed Up Git Pull

#5
A 50x speedup is pretty cool in its own right. Kudos.

However, I wonder if this isn't treating a symptom versus a root cause.

Is saving that 5s round-trip so common in your workflow that you needed to optimize it, and would it be more productive to refactor the app so you and collaborators are working on different files?

Also, this has the entirely valuable guidance that pushing to a local server is much faster than a remote server. There's a Github Enterprise product, for you to run close to you. It'd be an interesting calculation to see the performance hit from waiting 5s to push to a remote server, versus the performance hit from keeping your nearby server up and patched.

But nice to read, kudos all the same!

Re: Speed Up Git Pull

#6

If you're a heavy SSH user, using multiplexing in this manner can have negative consequences [1]. Downsides include having all your multiplexed connections exiting if the master exits! [1] http://www.anchor.com.au/blog/2010/02/ssh-controlmaster-the-...

> Downsides include having all your multiplexed connections exiting if the master exits!

I believe this is what ControlPersist is meant to solve - it may not have existed when that blog post was written.

Re: Speed Up Git Pull

#7
Are there any "shorter" options for ControlPath that are still unique? I've had a few instances of silly hostnames that have caused an error about the name being too long for the socket.

Re: Speed Up Git Pull

#8

If you're a heavy SSH user, using multiplexing in this manner can have negative consequences [1]. Downsides include having all your multiplexed connections exiting if the master exits! [1] http://www.anchor.com.au/blog/2010/02/ssh-controlmaster-the-...

More recent SSH clients can use "ControlPersist" to establish the master connection in the background, so the first session doesn't control the lifetime of the connection. This makes using ControlMaster workable.

I usually set ControlPersist to 30 seconds, which may not be long enough for people hoping to get performance improvements from GitHub, . Setting it to too large a value increases the risk that you'll have stale server sockets after a network outage.

Re: Speed Up Git Pull

#9
Hrm, so this isn't about making git 50x faster but fast network communication.

> Establishing an SSH connection every time you perform a Git operation costs many round-trips

I don't really understand why the author is saying this. The whole point of git is to be distributed and not to push/pull at each commit.

That being said, he found something that speeds up his workflow tremendously, so congratulations.

Re: Speed Up Git Pull

#10
Meta question: assuming that lots of GH users do this (nice trick), would GH have loads of dormant SSH connections? At scale, this could be a huge number. Would this be an issue?
Post reply on HN