shipping-docker / vessel

Up and running with small Docker environments
https://vessel.shippingdocker.com
MIT License
1.07k stars 106 forks source link

Very Slow IO on High Sierra #48

Closed fredlahde closed 5 years ago

fredlahde commented 6 years ago

Description

When using Vessel the application is very slow.

Maybe it has something to do with this issue: https://github.com/docker/for-mac/issues/77

OS

My OS is:

Docker

The output of docker version:

Client:
 Version:      17.09.1-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   19e2cf6
 Built:        Thu Dec  7 22:22:25 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.09.1-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   19e2cf6
 Built:        Thu Dec  7 22:28:28 2017
 OS/Arch:      linux/amd64
 Experimental: false

The output of docker-compose version:

docker-compose version 1.17.1, build 6d101fb
docker-py version: 2.5.1
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016
fideloper commented 6 years ago

Yep, that's certainly a thing with Docker on Mac currently - it uses a layer of virtualization since Mac's kernal (unix) doesn't play well with Docker (which needs Linux). Unfortunately I don't have control over that (altho I don't really have requests that slow on my projects- perhaps they're smaller. Perhaps is a MacBook - laptop - vs iMac - desktop - thing with access speeds).

Valet will always be faster on Mac since it's running PHP/Nginx (or Caddy, I forget which) directly on your Mac.

dbpolito commented 6 years ago

One way that helps is adding :cached after all volumes on the docker-compose.yml, you can see more info about it here:

https://stories.amazee.io/docker-on-mac-performance-docker-machine-vs-docker-for-mac-4c64c0afdf99 https://docs.docker.com/docker-for-mac/osxfs-caching/

I saw some good improvements here and no issues so far. I thought about opening a PR and defaulting i to cached (linux and windows basically ignores that flag).

Also, the new version released yesterday has some good performance improvements for High Sierra:

https://docs.docker.com/docker-for-mac/release-notes/#stable-release-notes

For systems running APFS on SSD on High Sierra, use raw format VM disks by default. This improves disk throughput (from 320MiB/sec to 600MiB/sec in dd on a 2015 MacBook Pro) and disk space handling. Existing disks are kept in qcow format, if you want to switch to raw format you need to “Remove all data” or “Reset to factory defaults”. See https://docs.docker.com/docker-for-mac/faqs/#disk-usage

You go on Docker > Preferences > Remove all data and it will start docker from scratch using the new Docker.raw format.

fideloper commented 6 years ago

Neat, thanks! On Wed, Jan 10, 2018 at 12:08 Daniel Polito notifications@github.com wrote:

One way that helps is adding :cached after all volumes on the docker-compose.yml, you can see more info about it here:

https://stories.amazee.io/docker-on-mac-performance-docker-machine-vs-docker-for-mac-4c64c0afdf99 https://docs.docker.com/docker-for-mac/osxfs-caching/

I saw some good improvements here and no issues so far. I thought about opening a PR and defaulting i to cached (linux and windows basically ignores that flag).

Also, the new version released yesterday has some good performance improvements for High Sierra:

https://docs.docker.com/docker-for-mac/release-notes/#stable-release-notes

For systems running APFS on SSD on High Sierra, use raw format VM disks by default. This improves disk throughput (from 320MiB/sec to 600MiB/sec in dd on a 2015 MacBook Pro) and disk space handling. Existing disks are kept in qcow format, if you want to switch to raw format you need to “Remove all data” or “Reset to factory defaults”. See https://docs.docker.com/docker-for-mac/faqs/#disk-usage

You go on Docker > Preferences > Remove all data and it will start docker from scratch using the new Docker.raw format.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/shipping-docker/vessel/issues/48#issuecomment-356687103, or mute the thread https://github.com/notifications/unsubscribe-auth/AAch09LstUZtUevcm97cVJJnBetfjehIks5tJPybgaJpZM4RKNnE .

fredlahde commented 6 years ago

That are some neat findings @dbpolito!

alexagui commented 6 years ago

Thanks!

In case anyone else was wondering where to find Remove all data. Docker > Preferences > Reset (💣in right corner)> Remove all data

pchico83 commented 6 years ago

We overcame this issue by synchronizing the local and the docker for mac filesystem using syncthing. We built an open source tool that follows this approach, in case it helps: https://github.com/okteto/cnd