Docker push incredibly slow to google registry

Viewed 1333

I have Google Instance and a Google Docker Registry configured. Things where working quite smoothly and suddenly when I try to push to the registry, it became practically unusable because of the speed.

$ docker push gcr.io/<ID>/my-registry/image:44]
The push refers to a repository [gcr.io/<ID>/my-registry/image:44]
3bc2db43a686: Pushing [=======>                   ]  3.409MB/23.32MB
1302d8ee9a47: Layer already exists 
29d71372a492: Layer already exists 

And if I measure the bandwidth of the docker push I get

NetHogs version 0.8.1

PID USER     PROGRAM              DEV        SENT      RECEIVED       
1521 root    /usr/bin/dockerd     ens4      24.183       0.458 KB/sec

But my actual connection to the internet is good enough.

$ speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Google Cloud (x.x.x.x)...
Selecting best server based on latency...
Hosted by KamaTera INC (Santa Clara, CA) [10.61 km]: 20.436 ms
Testing download speed........................................
Download: 2046.49 Mbit/s
Testing upload speed..................................................
Upload: 114.68 Mbit/s

I tried restarting the docker daemon and nothing.

This are the tools I am using

$ docker version
Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:42:18 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:56 2017
 OS/Arch:      linux/amd64
 Experimental: false
$ gcloud version
Google Cloud SDK 176.0.0
alpha 2017.10.13
beta 2017.10.13
bq 2.0.27
core 2017.10.13
gsutil 4.27

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:    16.04
Codename:   xenial

Any idea what could be the problem?

1 Answers

Use gcloud builds submit instead of docker push

Docs: https://cloud.google.com/sdk/gcloud/reference/builds/submit

I tried using docker push to get images to GCR, but it was incredibly slow and would eventually grind to a halt. I then started using GCE instances to docker push from, which was very fast. Later, I stumbled upon gcloud builds submit. It runs fast locally for me.

Related