ironstar-io / tokaido

Zero-conf Drupal Local Development Environments with Docker
https://tokaido.io
BSD 3-Clause "New" or "Revised" License
57 stars 10 forks source link

Proposal: Implement NFS support #230

Closed ironmike-au closed 4 years ago

ironmike-au commented 4 years ago

After discussions with clients, speed of Docker Volumes is a major issues. Investigating turning on NFS support and using it to replace Unison filesystem support.

ironmike-au commented 4 years ago

I've investigated using NFS as well as other newer techniques to improve performance, especially on MacOS. The results were surprising.

I tested five filesystem modes:

If anyone is interesting in understanding the difference between normal, cached, and delegated bind-mount modes in Docker For Mac, this article is very comprehensive. The tl;dr is:

In realty, the risk of things being inconsistent is very low, and in my testing wasn't even something I could detect when looking for it.

Here are the results based on composer install run inside the tokaido env on a small-medium-sized project

- running natively on macos - no docker
- > 15s

- using normal docker volumes (Tokaido 1.12)
- > 7m38s

- using 'cached' docker volumes
- > 3m51s

- using 'delegated' docker volumes
- > 3m57s

- using nfs
- > 3m13s

NFS support in MacOS is a mess. It's complex to set up, easy to break, and tends to have major breaking changes with each major MacOS release. Furthermore, there's some pretty unforgiving security requirements to turn it on, such as having NFS listening on your Mac to the outside world even if you're only using it locally.

I personally really dislike this, and I could turn it off, but it's a hassle and would be really burdensome to automate with Tokaido.

In the end, I don't think NFS support is worth it right now, it's only a litte faster than 'cached' mode and offers a lot of negatives.

I've created PR #233 to add cached mode on osx. It's a quick and simple change and boosts performance by 2x