docker on OSX slow volumes

前端 未结 10 1513
无人共我
无人共我 2021-02-02 08:24

I\'m trying to use docker beta on OSX, mainly for Symfony development but the mounted volumes are incredible slow. Even for a vanilla Symfony project I get 6s page load time. Th

相关标签:
10条回答
  • 2021-02-02 08:32

    There's a long thread with explanation from Docker Team and various workarounds.

    Currently, the issue is being tracked on GitHub.

    While some workarounds may be better than others, I'm afraid the ideal option for now is to switch to Linux.

    0 讨论(0)
  • 2021-02-02 08:38

    For people reading this now, maybe it's better to wait for Docker to fix this issue. A pull request has already been accepted to improve performance(https://github.com/docker/docker/pull/31047). This will be release somewhere in April 2017 and should be a big improvement.

    I've tried some workarounds for Docker for Mac, but all of them had some pretty big disadvantages, mostly in usability. A good source for alternatives of the OSXFS can be found at: https://github.com/EugenMayer/docker-sync/wiki/Alternatives-to-docker-sync. Credits for Eugen Mayer for setting this up.

    EDIT: First improvement is implemented in the edge release. https://github.com/docker/for-mac/issues/77 has more info on this.

    0 讨论(0)
  • 2021-02-02 08:39

    In latest docker 17.06.0-ce-mac18 volumes mounted with :cached seems to run quite decent.

    0 讨论(0)
  • 2021-02-02 08:39

    I've found that creating a CoreOS VM under Parallels, then using the Docker that is inside CoreOS is far faster than Docker for Mac (currently running Version 17.12.0-ce-mac49 (21995)).

    I'm doing Linux code builds using CMAKE/Ninja/GCC and it's almost twice as fast as the exact same build from Docker for Mac.

    In my case, I have a ton of library sources that are part of the container (e.g. Boost, OpenSSL), and a decent amount of C++ code that I keep local to my Mac.

    This seems to be a recent development. Docker/Mac has become much slower than I remember it being a month or two ago. Maybe it's just me...

    0 讨论(0)
  • 2021-02-02 08:44

    Normaly volumes should be fast. But you can not change anything to make them faster if you dont want to change the format of your disk.

    But maybe the bottleneck is the CPU or RAM. You can check that with the command docker stats. These are by default set to 2 cores and 2 GB RAM. You can change this in the Docker for Mac GUI.

    0 讨论(0)
  • 2021-02-02 08:46

    I had exactly the same thing. For me using docker-bg-sync (see on GitHub) made a dramatic improvement in speed and CPU usage.

    Not as nice as just mounting the volume as you have to start a new container for every sync but it does the job.

    0 讨论(0)
提交回复
热议问题