Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the gcloud command line tool so much faster than a browser upload?

Today, I was uploading a 1.55gb zip file to a gcloud instance. I followed the instructions here and used the upload file command from a browser window.

enter image description here

After getting frustrated this was taking too long (I waited for an hour and it said it was 12% done), I looked elsewhere in the tutorial and used the following command from my local terminal

gcloud compute scp [FILE-NAME] [INSTANCE-NAME]:/tmp/

Where the file uploaded in ~1 minute and 7 seconds (as opposed to an estimated 10 or so hours for the other method).

Why was the scp method so much faster? I don't see an explanation in https://cloud.google.com/compute/docs/instances/transfer-files, and intuitively, couldn't the upload command just run the scp command under the hood?

like image 838
rma Avatar asked Dec 10 '25 15:12

rma


1 Answers

The browser uses IAP tunneling, which is much slower than a direct SSH connection.

Note: Using the browser (IAP Tunneling) for file transfers is not recommended as there are data quotas. This is a convenience feature that is not designed for your use case.

Using an IAP tunnel does provide a useful benefit. Your Compute Engine instance does not need a public IP address. You can reach instances with only private IP addresses.

Browsers cannot launch programs such as scp.

The best method is to install an SSH/SCP product to do file transfers. I use Bitvise on Windows.

Here is a link for more information about IAP Tunneling (TCP Forwarding).

like image 104
John Hanley Avatar answered Dec 13 '25 05:12

John Hanley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!