GitHub taking forever to push/pull on Ubuntu 11.04
I've installed git on Ubuntu 11.04 and I've cloned a private respository on GitHub. Whenever I try to push or pull to/from the repository, it takes about 30-60 seconds. Even if their are no changes in the repository. When using the same repository on Windows 7, pull/push requests only take a few seconds. I can't figure out what is wrong.
I've ran ssh -v git@github.com and it hangs right after this line:
debug1: SSH2_MSG_SERVICE_ACCEPT received
The above line will take 30-60 seconds to complete and then the remaining lines finish within a sec开发者_如何转开发ond. Here is the full output of ssh -vvv git@github.com: http://pastebin.com/LdY0EifW
I've already tried changing "GSSAPIAuthentication" to "no" and "UseDNS" to "no" in /etc/ssh/ssh_config. That didn't make any difference.
Any ideas?
It seems like the system might be running out of entropy.
SSH, like any other cryptographic application, needs some truly random numbers to be able to provide security. Linux kernel normally gathers some randomness (entropy) from precise timing of various events and makes it available via /dev/random
, which ssh reads when it needs to create the session keys. On desktops there is usually enough entropy gathered, but if there is some other application that needs it, you might be running low and than reading /dev/random
will take a lot of time, because it's waiting for enough entropy to be collected.
=> please verify by running strace ssh git@github.com
whether it's actually waiting in read from `/dev/random. If yes, you have this problem.
If it's a server hosting any potentially sensitive data, you should probably equip it with hardware random number generator (e.g. the "entropy key"). You can also try to modify the random number generator settings to less secure ones (I believe there are some options to be set via /proc), but only if the server does not host customer data or any sensitive company data.
Edit: it looks more like a network problem somewhere.
I had a similar problem, although with all internet and not just push/pull of git. The problem was according to solutions to the same problem for many people either something with IPv6 or something with the driver:
So try these:
- Disable IPv6. See here <--- Note only do this if you know you won't use IPv6. Also remember this so if you needed later you can enable it.*
- Blacklist your driver. Follow this question for more instructions.
For me, the second case was the solution.
* I'm not sure what they shipped with Ubuntu 11.04, but there appears to be something wrong with DNS lookup when the network is in IPv4, but IPv6 is enabled, which makes it take a long time.
精彩评论