adlogix / docker-machine-nfs

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

change mount options for performance gain #38

Closed hc2p closed 8 years ago

hc2p commented 8 years ago

following the advise found in this article, i changed the mount options accordingly. This gives me way faster results when polling for file-changes inside a container.

ascariandrea commented 8 years ago

Like ten times faster for a container running webpack with source code mounted as volume :+1:

chrisdostert commented 8 years ago

Unfortunately when I try this my sbt build runs about 3x slower

tonivdv commented 8 years ago

Hey,

This is a tricky change. As you can see it's not a "one setting rules it all" ... I'd be more in favor of providing a command line option to override this (e.g. --mount-opts=xxx).

I already had in mind of having a configuration file located in the user dir (e.g. ~/.docker-machine-nfs.config) in order to be able to define your own defaults which avoids a user to always have to provide it through the command line.

What ya think? :)

Cheers

alexanderjulo commented 8 years ago

I think to have an option also on the side of boot2docker and not only on the host side makes, sense, but we should still have sensible defaults. Please also refer to https://github.com/mitchellh/vagrant/issues/4204#issuecomment-49856008 where a user took the time to test a set of different options.

For now I just patched my personal docker-machine-nfs to include exactly the options that were also provided in this pull request and the performance has greatly improved.

tonivdv commented 8 years ago

@alexex I completely agree that we should have the most performant default mounting options. I could accept this and see how it goes ... but I still think we should be able to override them without having to change the code base or patch manually like you did :)

Let me try out those and if I don't find any issues I'll merge this.

Thanks for the feedback.

Cheers

tonivdv commented 8 years ago

@chrisdostert On your machine it works faster with the current default values? So if I merge this config it will not suit you at all?!

j0hnsmith commented 8 years ago

I got

sudo mount -t nfs -o noacl,async,actimeo=2 ...

from https://github.com/gulpjs/gulp/issues/448 and it works well for me (for a gulp watch).

kilpatty commented 8 years ago

+1 Wold like the option to mount with actimeo=2

Edit: I just changed my personal copy of docker-machine-nfs to include all of the options that are in this pull request. I am running gulp watch in a docker container. Before using these edits, when saving a html file on my mac, it would take over a minute for the docker container running gulp watch to recognize it and run the task. After changing these options, that delay has been reduced to under 2 seconds.

tonivdv commented 8 years ago

This is fixed with #45