
- #MACOS DOCKER HYPERKIT CPU FOR MAC#
- #MACOS DOCKER HYPERKIT CPU INSTALL#
- #MACOS DOCKER HYPERKIT CPU PRO#
- #MACOS DOCKER HYPERKIT CPU CODE#
#MACOS DOCKER HYPERKIT CPU INSTALL#
docker-sync.ioĭocker-sync is a Ruby gem (installed via gem install docker-sync) which requires an additional configuration file ( docker-sync.yml) alongside your docker-compose.yml file, which then requires you to start docker-sync prior to starting your docker-compose setup. But at least on macOS, everything is built-in, and you don't have to install anything extra, or run any extra containers to be able to get the performance benefit.

So, for NFS, there are a few annoying steps, like having to manually add an entry to your /etc/exports, modify the NFS configuration, and restart NFS. Some of this info I picked up from this gist and it's comments, especially the comment from egobude about the changes required for Catalina. for older macOS versions you would use /Users instead, and for locations outside of your home directory, you have to grant 'Full Disk Access' in the privacy system preference pane to nfsd. Note that I have my project in ~/Sites, which is covered under the /System/Volumes/Data umbrella. Then, to make sure my Docker Compose service could use an NFS-mounted volume, I added the following to my docker-compose.yml:. Then I restarted nfsd so the changes would take effect: sudo nfsd restart I added the following line (to tell the NFS daemon to allow connections from any port-this is required otherwise Docker's NFS connections may be blocked): _resv_port = 0 I also edited my NFS config file: sudo nano /etc/nfs.conf (When I saved the file macOS popped a permissions prompt which I had to accept to allow Terminal access to write to this file.) I added the following line (to allow sharing any directories in the Home directory-under older macOS versions, this would be /Users instead): /System/Volumes/Data -alldirs -mapall=501:20 localhost I edited my Mac's NFS exports file (which was initially empty): sudo nano /etc/exports To use NFS, I had to do the following (note: this was on macOS Catalina-other systems and macOS major versions may require modifications):

#MACOS DOCKER HYPERKIT CPU PRO#
The second benchmark loads the home page ( /) immediately after the installation this page load is entirely uncached, so Drupal again reads all the thousands of files from the filesystem and loads them into PHP's opcache, then finishes its operations.īoth benchmarks were run four times, and nothing else was open on my 2016 MacBook Pro while running the benchmarks. The database is stored on a separate Docker volume, and not shared, so it is plenty fast on its own (and doesn't affect the results).
#MACOS DOCKER HYPERKIT CPU CODE#
The operation requires loading thousands of code files from the shared volume, writes a number of files back to the filesystem (code, generated templates, and some media assets), and does a decent amount of database work. The first benchmark installs Drupal, using the codebase. Since around 2016, support has been around (albeit barely documented) for NFS volumes in Docker (see Docker local volume driver-specific options).Īs part of my site migration project, I've been testing different local development environments, and as a subset of that testing, I decided to test different volume/sync options for Docker to see what's the fastest-and easiest-to configure and maintain.īefore I drone on any further, here are some benchmarks: Since then, the File system performance improvements issue has been a common place to gripe about the lack of improvements to the underlying osxfs filesystem. It was painfully slow, and the community finally got a cached mode that offered a 20-30x speedup for common disk access patterns around 2017.

#MACOS DOCKER HYPERKIT CPU FOR MAC#
So, read on.Įver since Docker for Mac was released, shared volume performance has been a major pain point. September 2020 Update: Alas, Docker for Mac will not be getting built-in Mutagen support at this time. Hopefully that feature makes it to the standard Docker for Mac version soon. July 2020 Update: Docker for Mac may soon offer built-in Mutagen sync via the :delegated sync option, and I did some benchmarking here. But it's actually fairly performant using the barely-documented NFS option!

It's acceptable (but still very slow) if you use the cached or delegated option. Tl dr: Docker's default bind mount performance for projects requiring lots of I/O on macOS is abysmal.
