Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 739
Mark Shust at M.academy Avatar asked May 01 '15 13:05

Mark Shust at M.academy


People also ask

Why is gcloud so slow?

Prioritize primary content​ The Google Cloud page loads a large initial JavaScript bundle. The longer it takes to load and initialize this code, the longer it takes to load page-specific code and to render the list of Cloud Functions the user wants to see.

What is the difference between Google App Engine and Google Compute Engine?

Google App Engine is a Platform as a Service (PaaS) solution that makes deployment easier. On the other hand, the Google Compute Engine is an Infrastructure as a Service (IaaS) tool.


3 Answers

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!

like image 77
vtrubets Avatar answered Oct 08 '22 11:10

vtrubets


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

like image 39
Mark Shust at M.academy Avatar answered Oct 08 '22 11:10

Mark Shust at M.academy


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.

like image 22
Andrew Cooper Avatar answered Oct 08 '22 09:10

Andrew Cooper