Mark Shust at M.academy
Mark Shust at M.academy

Reputation: 6429

google compute engine tool gcloud is exceptionally slow

I tried downloading and using the gcloud bash tool to manage my accounts, however everything I do with the tool is exceptionally slow. It will take MINUTES to reply to a command that is typed.

Is there perhaps a firewall I need to open up on my router or something else to get this to work fast like it's supposed to? For example, the "Installing..." lines in this video https://youtu.be/4y4-xn4Vi04?t=1m21s -- you'll notice they are all complete in the tutorial within a few seconds. This takes over 10 minutes to complete on my machine.

I'm on a newer Macbook Air, and all other internet/etc works really fast. I'm on a decent speed internet connection from AT&T Uverse (30mbps/3mbps). All other browsing is fast and just fine, the only thing in the world I have a problem with is this gcloud tool.

Upvotes: 25

Views: 16619

Answers (5)

user23320253
user23320253

Reputation: 1

In my case I using WSl, however my local computer using window already install gcloud cli and it making it so slow when using on WSL. So I resolve it by install again the gcloud cli on my WSL ubuntu follow the document. https://cloud.google.com/sdk/docs/install#deb

Upvotes: 0

Sergey Mucha
Sergey Mucha

Reputation: 9

Same behavior for me. Simple command hang on

gcloud compute instances list --log-http --verbosity debug

DEBUG: Starting new HTTPS connection (1): oauth2.googleapis.com:443

If I ping oauth2.googleapis.com PING oauth2.googleapis.com(sof02s34-in-x0a.1e100.net (2a00:1450:4017:80b::200a)) 56 data bytes you can see IPv6. In my case I have router Zyxel EX3301-T0

Disable LAN IPv6 Mode Setup and ping oauth2.googleapis.com PING oauth2.googleapis.com (172.217.17.138) 56(84) bytes of data. 64 bytes from 172.217.17.138 (172.217.17.138): icmp_seq=1 ttl=114 time=82.8 ms

Upvotes: 0

Andrew Cooper
Andrew Cooper

Reputation: 31

Mark Shust's answer hinted to me that something might be going on with IPv6. Turning this support off in my router brought the gcloud times back to a couple of seconds from over 2 minutes for a gcloud compute machine-types list.

Note: I've also had to turn off IPv6 support in apt for a similar reason so this is likely a problem with my router or ISP, not the google cloud sdk.

Upvotes: 3

vtrubets
vtrubets

Reputation: 361

I just ran into a similar issue myself, though not as bad as minute long response times. What helped me was turning off the usage reporting.

Looking at some timings:

$ gcloud config set disable_usage_reporting False
$ time gcloud compute -h | tail -1
  real  0m7.058s
  user  0m0.464s
  sys   0m0.088s

A whopping 7 secs to access the help!

Fortunately, this improves greatly after disabling reporting:

$ gcloud config set disable_usage_reporting True
$ time gcloud compute -h | tail -1
  real  0m0.541s
  user  0m0.459s
  sys   0m0.080s

Much better!

Upvotes: 21

Mark Shust at M.academy
Mark Shust at M.academy

Reputation: 6429

I traced this back to packet filters. When I deleted this rule #5 in my AT&T Uverse modem/router (Motorola NVG589), everything works ok. This was a default setting in the modem which caused all sorts of issues.

packet filters

Upvotes: 12

Related Questions