Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Slow SSH clone/pull/push

Xerillio December 3, 2018

For a few months now I think, whenever I'm pushing/pulling/cloning (or i guess doing other network related GIT operations) it takes forever before anything actually seems to happen. That is, it takes around 1 minute before it starts fulfilling the task.

I'm using GIT through "Bash on Ubuntu on Windows" and if I clone using HTTPS there's no problem, however, with SSH it takes too long before it starts. I have tested both HTTPS and SSH for Bitbucket and GitHub and it only seems to be SSH for Bitbucket that is slow.

Example: cloning a repo of less than 2MB takes around 1m10s, while only in the last second the files are actually written to the disk.

I don't know if this could have anything to do with the relatively recent update to the Bitbucket IPs, but deleting my "known_hosts" in ~/.ssh didn't not help either. Is this a known issue? Common GIT tasks are becoming quite cumbersome.

5 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

61 votes
Answer accepted
giridharkannan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 28, 2019

After breaking my head for a day, have figured out the root cause of the issue.

SSH supports both IPv4 and IPv6 and prefers IPv6 if the DNS retrieves AAAA record, but my ISP doesn't support IPv6, which results in huge delays

We can solve it in two ways

  1. Filter out AAAA replies so that we are left with IPv4 address (too much work)
  2. Set "AddressFamily inet" in /etc/ssh/ssh_config to force IPv4 connection

 

After changing ssh_config do restart ssh client, on Ubuntu the command is

"sudo service ssh restart"

Xerillio January 29, 2019

Amazing, that seems to have done it. Thanks a lot for the suggestion.

luisgmail
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 11, 2019

This was my exact problem, perhaps Movistar Perú doesn't support IPv6 either.

Not surprised.

Thank you!

midboh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 12, 2019

My problem too. I had been copping 15 minute delays.

Massive thanks.

Calvin Pietersen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 14, 2019

this was also my problem. 

Christopher Brace
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 14, 2020

I even had this happening on an EC2 instance I was remoting into. Thanks a ton!

Jorge Montoya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 10, 2020

That was a relief. Thank you!

John Halbert March 25, 2020

Awesome! Perfect! This has been going on for a while for me! Thanks so much!

PapayaMedia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 29, 2020

Thank you!!!

It was driving me crazy. Doing "git pull" in any of my repositories was taking 18 minutes... 18 MINUTES!!! to just show "Already up-to-date.".

I just moved to a new home on Feb 29th and I started noticing this in my new home. I was totally sure the problem was with the new internet configuration (a router acting as a switch behind the ISP router) and I tried a lot of configurations but nothing fixed the error. Only today, when I connected my PC with an ethernet cable directly to the ISP router and it didn't fix the error, I started thinking the problem was Bitbucket and not my home network. That made me look for a solution here.

Once I added your setting suggestion to ssh_config, it immediately worked.

Thank you, thank you, thank you.

Edwin Choi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 13, 2020

This worked for me.

* Windows 10

* WSL

* ssh

`git pull` went from minutes to seconds.

Raul Riili
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 29, 2020

This worked for me too!

Anuj Kumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 28, 2020

Thanks. Today you have saved my life. I was struggling since morning.

Dorian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 12, 2021

Thank you a lot!

Ricardo de Carvalho
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 11, 2021

Thanks. For me:

Set "AddressFamily inet" in /etc/ssh/ssh_config to force IPv4 connection

Adrian Salazar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 27, 2021

Second option worked for me like a charm.

I am on Spain using Digi ISP.

htrujillo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 29, 2022

Funcionó a la perfección, de momento a otro tenía lentitud.

8 votes
Gnanajeyam95
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 9, 2020

Navigate to this folder C:\Users\<username>\.ssh

Create new config file if it not presented.

To create a new config file.

Open git bash from the folder and enter below command.

touch config


Once you created the file, open the file and add the below text.

AddressFamily inet

Save it and close the file.

Reload the terminal and try here. It will work

atrandafir
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 31, 2021

ty mate, this worked for me

kvaitulys
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 12, 2021

this worked for me. thanks

Sameera Kumarasingha
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 9, 2021

thanks, on windows 11

2 votes
Csonger Fagyal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 4, 2019

Same problem here (Hungary).

I get ~30KiB/s with git clone via ssh.

Both on IPv4 and IPv6.

Other git providers are about 100x faster on the same network.

0 votes
Ben
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 2, 2019

same problem here, any suggestion to that?

First time I experience something like that.

Screenshot 2019-11-02 at 15.54.30.png

Xerillio November 2, 2019

Can you describe your issue in more details? It seems to me that your issue is more about slow download speed, which seems slightly different.

Did you try the solution giridharkannan posted?

Have you checked if there's a general issue with your download speed (not just in GIT)?

Ashok Rabadiya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 9, 2020

Same problem here

image.png

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 17, 2018

Hi Casper! Are you still experiencing this issue? Did you have a chance to try a different network?

Let us know!

Ana

Xerillio December 19, 2018

Hey Ana

Thanks for the suggestion. Apparently there must be something to it. At work I had no problems and turning on VPN from home also helped... question is why :/

Could it be my router or ISP that is somehow filtering that connection? Although I don't see why I would have no trouble with GitHub then...

Xerillio December 20, 2018

Hmm, installing Wireshark I can see that it must be something inside bash/git itself, because no packets are captured until after a minute of silence. SSH'ing against GitHub instantly shows packets being transferred however.

Perhaps I should reinstall git or maybe even bash if there's no other way :/

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events