adlogix / docker-machine-nfs

Activates NFS on docker-machine
MIT License
794 stars 104 forks source link

Volumes still rather slow #58

Closed BastianHofmann closed 7 years ago

BastianHofmann commented 8 years ago

I'm running a rails application in a container with the root directory as a volume.

Excerpt from docker-compose.yml:

app:
    image: "some/image:tag"
    command: "bundle exec rails s -b 0.0.0.0"
    volumes:
        - "./:/var/www"
    links:
        - db
        - redis
    ports:
        - "80:3000"
    environment:
        - ...

When I use the standard virtual box sharing, it takes about 10 seconds to load a single page. With docker-machine-nfs it takes about 2 seconds. I also tried https://github.com/brikis98/docker-osx-dev, which uses rsync. With docker-osx-dev a page load takes about 200ms.

Is this performance hit realistic or did I do something wrong?

PS: I would use docker-osx-dev, but unfortunately the rsync sharing works only in one direction...

snipebin commented 8 years ago

I've had the same experience. Seems like networking overhead: http://www.jeffgeerling.com/blogs/jeff-geerling/nfs-rsync-and-shared-folder

wysow commented 8 years ago

Some update about this?

tonivdv commented 8 years ago

@wysow It's not really in the scope of the project. It only configured the box to use nfs. Which nfs configuration you need to use depends on the type of project you are going to run.

Try playing with different nfs config and see which one suits best.