Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

pull is extremely slow and often fails #577

Closed
tomdavidson opened this issue Jun 2, 2015 · 18 comments
Closed

pull is extremely slow and often fails #577

tomdavidson opened this issue Jun 2, 2015 · 18 comments
Labels

Comments

@tomdavidson
Copy link

Im new to OSX from Gnu/Linux and trying to use Kitematic and docker-compose. When I need to pull an image either via a docker-compose command or directly, the network is brutally slow and often fails. For example:

bash-3.2$ docker pull mariadb
Pulling repository mariadb
FATA[0000] Get https://registry-1.docker.io/v1/repositories/library/mariadb/tags: dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: too many redirects

Found sim issue for boot2docker: boot2docker/boot2docker#451 I would like to check out the Kitematic network but VBoxManage list vms shows no virtualmachine for Kitematic.

@mchiang0610
Copy link
Contributor

@tomdavidson Thanks for sending this in. It appears to be a problem with the NS records being changed on your laptop.

Can you go click on the Docker CLI button through Kitematic:

run:
echo "nameserver 8.8.8.8" > /etc/resolv.conf

Feel free to replace the name server IP with another one you trust. 8.8.8.8 is one of Google's

Please re-open this if you are still having trouble.

@tomdavidson
Copy link
Author

Im not use to OSX, please be patient if this is obvious.... the resolv of the virtual machine hosting docker or of my laptop?

My laptop is using the assigned DNS via dhcp that I have been running for quite awhile without issue until using Kitematic today.

Toms-MBP:~ tom$ bash -c "export PATH='/Applications/Kitematic (Beta).app/Contents/Resources/app/resources:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' clear && DOCKER_HOST=tcp://192.168.99.100:2376 DOCKER_CERT_PATH=/Users/tom/.docker/machine/machines/dev DOCKER_TLS_VERIFY=1 $SHELL"
bash-3.2$ echo "nameserver 8.8.8.8" > /etc/resolv.conf
bash: /etc/resolv.conf: Permission denied
bash-3.2$
bash-3.2$ sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf
bash: /etc/resolv.conf: Permission denied
bash-3.2$

@mchiang0610
Copy link
Contributor

Hi @tomdavidson; I meant the resolv of the vm. Sorry for that.

  1. Click on the Docker CLI button
    image
  2. Type in docker-machine ssh
  3. echo "nameserver 8.8.8.8" > /etc/resolv.conf

@tomdavidson
Copy link
Author

that is exactly what I did. if the output is unexpected, may kitematic is not configured correctly on my machine - OSX 10.10.3. I have an exciting install of VirtualBox and ChefDK but not boot2docker.

Is the DOCKER CLI command as expected?
bash -c "export PATH='/Applications/Kitematic (Beta).app/Contents/Resources/app/resources:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' clear && DOCKER_HOST=tcp://192.168.99.100:2376 DOCKER_CERT_PATH=/Users/tom/.docker/machine/machines/dev DOCKER_TLS_VERIFY=1 $SHELL"

@mchiang0610
Copy link
Contributor

@tomdavidson in your log, I didn't see the

docker-machine ssh command. Without it, it wouldn't work.

@tomdavidson
Copy link
Author

changed my laptop's /etc/resolv.conf not the vm. ok, nice to know where the issue is. with I click on the DOCKER CLI link from Kitematic, it opens a term with the provided command entered. Can you tell me how it is suppose to be?

@tomdavidson
Copy link
Author

closed down all terminals and tried again and I affirm the following is the exact command that DOCKER CLI provides:
bash -c "export PATH='/Applications/Kitematic (Beta).app/Contents/Resources/app/resources:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' clear && DOCKER_HOST=tcp://192.168.99.100:2376 DOCKER_CERT_PATH=/Users/tom/.docker/machine/machines/dev DOCKER_TLS_VERIFY=1 $SHELL"

@tomdavidson
Copy link
Author

I removed Kitematic, the resources from my ~/Library folder and the machine from ~/.docker. Unpacked Kitematic again. So original vm unmodified from me and I still have the same problem.

Modified the resolv.conf and then I am able to docker pull. Shouldnt this be an open bug rather than a closed support request?

@mchiang0610 mchiang0610 reopened this Jun 12, 2015
@mchiang0610
Copy link
Contributor

@tomdavidson Can remove the "dev" VM inside virtualbox, and restart Kitematic (v0.6.5)?
There had been a problem with Docker Hub, and it should be fixed now.

@tomdavidson
Copy link
Author

@mchiang0610 i understand kitematic more now - its not creating and configuring the 'dev' vm right? just a node.js ui app? seems to be a boot2docker and vbox issue. ill report back when i can attempt to replicate.

@mchiang0610
Copy link
Contributor

@tomdavidson That is correct, but instead of boot2docker, we use Docker's latest Docker-machine.

@mchiang0610
Copy link
Contributor

Closing this because it's a Hub issue most, and due to it, Kitematic may be slow in pulling.

The Hub team is aware and are making performance improvements.

@stav09
Copy link

stav09 commented Dec 10, 2015

I realise this is closed, but its still highly rated from searches. We too have been battling terrible docker pull performance from OS X (using the Docker Toolbox).

The issue turned out to be the default network adapter provided by VirtualBox for the boot2docker guest (provisioned by docker-machine and Kitematic). Changing the network adapter type to 'PCnet-FAST III' made a huge improvement in performance (by default the type was 'Intel PRO/1000 MT Desktop').

For those with their own registries, running the latest registry:2 with docker-engine 1.9 gives even better pull performance with concurrent layer downloads.

@FrenchBen
Copy link
Contributor

I followed your change of network interface, but during the VM restart, the changes are not kept.
Are you sure that your changes are retained?

vnet-stop

vnet-start

@stav09
Copy link

stav09 commented Dec 14, 2015

I've only changed the adapter type for Adapter 1, which is attached to 'NAT'.
My 'Host-only Adapter' is left unchanged.

I've checked restarting the VM and the changes do persist.

@shivece
Copy link

shivece commented Dec 28, 2015

I felt compelled to +1 and bump this. I had TERRIBLE pull performance on my Mac with Toolbox and Virtualbox. Changing the adapters as indicated above brought performance to what I was expecting.

@nathanleclaire
Copy link
Contributor

I'd be willing to consider switching the default NICTYPE for NAT to virtio-net which IIRC is the most performant.

@kaikai2
Copy link

kaikai2 commented Jun 22, 2016

Thanks @nathanleclaire ! I'm having the same problem in docker pull big layers (2G+) on MAC. As slow as 50-100KB/sec.
Changing the Adapter type of NAT virtio-net and restart the docker-machine solved this and got a great speed raise at 8-15MB/sec, though its still slower than 20-22MB/sec for small layers (<100MB).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants