Skip to content

Bind mounts are really slow #3677

Open
Open

Description

@Miksu82
  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: CE10E9E0-4D58-4D8C-8533-82134EF088B2/20190520070056

Disk IO from/to container to/from host is really slow. I am running some IO heavy unit/integration/end-to-end test workloads that take ages to complete. My co-workers using Linux don't have that problem

I know this has been discussed in several issues already (such as #2707, #1592) and buried inside them may have suggestions for configurations that should improve performance or comments that docker-sync should be used etc.

But it would be nice to have the following from the Docker team:

  1. Documentation what causes this issue.
  2. Documentation and how-to's to improve the performance (configurations?, VirtualBox instead of HyperKit?)
  3. Is there work on-going to improve situation. If there is, is there a pull-request/ticket/branch or something else where this work can be followed and collaborated.

Expected behavior

File reads/writes between container and host are ~same as inside container.

$ docker run --rm -it -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
100000+0 records in
100000+0 records out
real	0m 0.37s
user	0m 0.03s
sys	0m 0.31s

Actual behavior

$ docker run --rm -it -v "$(PWD):/pwd:delegated" -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
100000+0 records in
100000+0 records out
real	0m 31.82s
user	0m 0.34s
sys	0m 3.04s
$ docker run --rm -it -v "$(PWD):/pwd:cached" -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
100000+0 records in
100000+0 records out
real	0m 34.16s
user	0m 0.21s
sys	0m 3.78s

Information

  • macOS Version: 10.14.4
  • Docker for Mac: 2.0.0.3
  • Docker Engine: 18.09.2
  • Docker Machine: 0.16.1

Steps to reproduce the behavior

$ docker run --rm -it -v "$(PWD):/pwd" -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000

Activity

  1. Renrhaf commented on May 22, 2019

    @Renrhaf

    I'm also experiencing similar issue with the 2.0.0.3 version on Docker for mac, same configuration as user ahead. My web projects based on Drupal are now so slow I can not even load a page.

    ➜  docker run --rm -it -v "$(PWD):/pwd" -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
    100000+0 records in
    100000+0 records out
    real	0m 27.87s
    user	0m 0.14s
    sys	0m 3.53s
    
  2. pvande commented on Jun 4, 2019

    @pvande

    I also experience this with 2.0.0.3. (macOS version 10.14.3)

    $ docker run --rm -it -v "$(PWD):/pwd" -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
    
    100000+0 records in
    100000+0 records out
    real	1m 16.87s
    user	0m 0.47s
    sys	0m 4.96s
    

    Restarting the Docker daemon does help somewhat, albeit temporarily.

    $ docker run --rm -it -v "$(PWD):/pwd" -w /pwd alpine time dd if=/dev/zero of=speedtest bs=1024 count=100000
    
    100000+0 records in
    100000+0 records out
    real	0m 40.75s
    user	0m 0.26s
    sys	0m 4.67s
    

    Diagnostics: 7536A828-0956-4629-9EB0-47BB753EA663/20190604034728

  3. docker-robott commented on Sep 2, 2019

    @docker-robott
    Collaborator

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale comment.
    Stale issues will be closed after an additional 30d of inactivity.

    Prevent issues from auto-closing with an /lifecycle frozen comment.

    If this issue is safe to close now please do so.

    Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
    /lifecycle stale

  4. Miksu82 commented on Sep 2, 2019

    @Miksu82
    Author

    Not fixed
    /remove-lifecycle stale
    /lifecycle frozen

  5. USSliberty commented on Oct 15, 2019

    @USSliberty

    Just my experience:
    I am currently using Docker Desktop 2.1.0.3 (macOS Mojave & Catalina) for develop in nodejs with nodemon.
    Everytime nodemon restart the nodejs process due to a change, the entire startup process gets slower and slower till it becomes unusable, not only the actual container but also the other containers running on my Mac.

    The only "workaround" is to restart Docker Desktop entirely.

    Also my colleagues experience the same behaviour, they have grunt that reload the project for every change.

  6. fefe79 commented on Jan 31, 2020

    @fefe79

    It is still happening.
    Are there NOT enough Mac Docker user which would make this as a priority to fix ASAP?

    Docker is a great tool if you are on Linux, not so much on Windows or Mac, but it could be if annoying performance errors/bugs like this would be fixed quick, as otherwise it is way more easier to use Docker on Linux natively which is more productive.

    I have tried to use the docker-sync project, but I think it is not yet workable it was working for 1 week, than all of a sudden not and I did not even updated my Mac nor changed anything in the docker-compose file.

    Why do we need an project like docker-sync when this should be a priority to fix quickly to natively work properly?

    It seems because some project manager/leader in Google/Docker just seems not care enough to push the issue through to be fixed FAST!!!!

    I hope it will be fixed, otherwise it is just a crap thing on the Mac which is used for marketing or false sense of quality.

  7. LorenzoS92 commented on Feb 2, 2020

    @LorenzoS92

    +1 UP.

  8. liorfranko commented on Mar 4, 2020

    @liorfranko

    +1

  9. sul4bh commented on Mar 27, 2020

    @sul4bh

    8sec on a RaspberryPi
    vs
    50sec on a Macbook Pro

    Dump your macbooks and start carrying a RPi.

  10. johnsnowdies commented on Apr 4, 2020

    @johnsnowdies

    How do you think, downgrading to boot2docker (CLI for virtualbox with guest linux system) solve this problem?

  11. 17 remaining items

  12. z1r0- commented on Apr 12, 2021

    @z1r0-

    I use docker-sync. It creates a folder-sync between your fs-folder and a docker-volume. docker-volumes have great performance. Sure you use up double the space, but I still prefere this approach instead of having a VM.

    I'm currently working on a huge (ugly) Django/Python Project with 90+ custom packages which sourcecode has to be mounted because it's part of the the project. Just running ./manage.py w/o any command takes nearly a minute with bind mounts. Completely unusable. With docker-sync it takes about 2 seconds. I really hope bind mounts can reach this lvl of performance someday.. but we are waiting since the first release and the improvements so far had been very little..

    I'm on 3.3.0 Apple Silicon Preview.

  13. justindoody commented on Aug 3, 2021

    @justindoody

    Why is this such a low priority... are we ever going to see improvement here? It's been years 😞

  14. kevinquillen commented on Aug 18, 2021

    @kevinquillen

    docker-sync requires ruby, I'd prefer our devs not having to deal with ruby. I simply do not understand why this cannot be addressed on Mac - as the last comment states, its been years. The performance is unacceptable. M1 will make virtually no difference.

  15. adarobin commented on Sep 2, 2021

    @adarobin

    @keywinf well they need to figure out something if they expect people to start paying for it now

  16. maxtrem commented on Nov 21, 2021

    @maxtrem

    Any updates?
    Are there any plans to address this issue?

    As slow as it is now it is virtually unusable ..

  17. chertov commented on Nov 30, 2021

    @chertov

    My build process is very slow in a docker container, but it is 5-7 times faster on a native platform.. gRPC fuse is very slow!

  18. vraravam commented on Dec 12, 2021

    @vraravam

    I have the same issue: Macos 12.0.1, docke for macos is very slow. I'm trying this on a basic springbot starter application

  19. jamescostian commented on Dec 12, 2021

    @jamescostian

    Have you tried the the VirtioFS experimental build? It does have a notable bug (opcode 40 doesn't work), but it should help tremendously in any situation where you don't run into that specific bug. Others have seen really good improvements.

  20. hongliang5316 commented on Jan 24, 2022

    @hongliang5316

    Has anyone solved this problem, it's really bad to mount with docker on mac.

  21. mrvisser commented on Jan 24, 2022

    @mrvisser

    @hongliang5316 you should have a look at docker/roadmap#7

  22. hongliang5316 commented on Feb 6, 2022

    @hongliang5316

    @mrvisser
    I tried it, but it seems to be getting more stuck.

  23. SampsonCrowley commented on Dec 11, 2025

    @SampsonCrowley

    it's bullshit that to have a usable bind mount in osx, which is a feature native to linux without any other config, you have to pay for a pro subscription.

    there are plenty of things that a pro subscription makes sense for. basic usability shouldn't be one of them

  24. ain commented on Dec 13, 2025

    @ain

    it's bullshit that to have a usable bind mount in osx, which is a feature native to linux without any other config, you have to pay for a pro subscription.

    @SampsonCrowley I believe the host volume mounts on macOS are part of the free offering, they're just terribly slow. If you found a paid option to get them up to speed, what did you have in mind? AFAIK, the VSCode integration is not really about binds, it's more about running the entire thing in the container.

  25. SampsonCrowley commented on Dec 13, 2025

    @SampsonCrowley

    they're just terribly slow.

    @ain Yeah to the point of unusable. Only osx users have this level of slowdown for basic usability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions