Skip to content

Use delegated flag to speedup volumes on macOS #299

Closed

Description

@TriAnMan

Docker for mac has introduced flags for volumes in 17.04.0. This feature addresses performance of shared folders on macOS: moby/moby#31047

Activity

  1. yosifkit commented on Jun 13, 2017

    @yosifkit
    Member

    That is a run time specified option and nothing we can add to the Dockerfiles. It could be possible to mention in the Official Image docs on the Docker Hub, but it is really a system specific option and probably could cause data loss in some situations.

    Maybe Docker should mention it prominently in the Docker for Mac docs or a popup when using shared volumes on Docker for Mac itself.

    Closing since this is not something we can address in this git repo.

  2. TriAnMan commented on Jun 13, 2017

    @TriAnMan
    Author

    @yosifkit
    I thought this repo can provide an environment variable to set a corresponding flag to the default volume.
    Otherwise user should create a volume and map it to the container with something like

    $ docker volume create pgdata
    $ docker run -v pgdata:/var/lib/postgresql/data:delegated postgres
    

    And it would be hard to override this flag for a default volume for already created containers.

  3. yosifkit commented on Jun 13, 2017

    @yosifkit
    Member

    We can only provide the VOLUME as a "this is the folder you should save for persistence" and cannot give it any sort of arguments. What you suggest is almost exactly what users must do to take advantage of the Consistency flag. As suggested it would have no effect since it is not sharing the volume to the Mac anyway. To take advantage, they would need to be using a folder from their Mac:

    $ docker run -v /local/directory/on/mac/:/var/lib/postgresql/data:delegated postgres
  4. jwg2s commented on Oct 17, 2017

    @jwg2s

    @yosifkit can this performance benefit be gained by specifying it in a docker-compose.yml file, like so:

    volumes:
      app-pgdata:
    
    db:
      image: postgres:9.6.3
      ports:
        - 5432:5432
      volumes:
        - app-pgdata:/var/lib/postgresql/data:delegated

    We're experiencing slow database response times on local development with Docker for Mac Version 17.09.0-ce-mac35 and wondering if there's some tuning we could do without something more dramatic like http://docker-sync.io/

  5. tianon commented on Oct 17, 2017

    @tianon
    Member

    @jwg2s that's a volume (app-pgdata), not a bind mount; to quote @yosifkit from above:

    To take advantage, they would need to be using a folder from their Mac:

    (ie, a bind mount, not just a volume)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions