2

New Docker for Mac VirtioFS file sync is 4x faster

 2 years ago
source link: https://www.jeffgeerling.com/blog/2022/new-docker-mac-virtiofs-file-sync-4x-faster
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

New Docker for Mac VirtioFS file sync is 4x faster

March 19, 2022

Docker for Mac's shared volume performance saga continues!

After monitoring the issue File system performance improvements for years (discussion has moved to this issue now), it seems like the team behind Docker Desktop for Mac has finally settled on the next generation of filesystem sync.

For years, the built-in osxfs sync performance has been abysmal. For a Drupal developer like me, running a default shared volume could lead to excruciating slowdowns as PHP applications like Symfony and Drupal scan thousands of files when building app caches.

Or God forbid you ever have to install dependencies using Composer or NPM over a shared volume!

It got to the point where I started using NFS to speed up volume performance. Heck, the Docker team almost added Mutagen sync, which I tested successfully, but it caused problems for too many projects.

But (hopefully) no more! The latest version of Docker Desktop for Mac includes new toggles under the 'Experimental Features' section:

Docker for Mac Preferences - VirtioFS volume mount file synchronization option

I tested with the defaults (both features disabled, and 'Use gRPC FUSE for file sharing' under the 'General' tab), and then with VirtioFS enabled, and the results speak for themselves:

  • Defaults (gRPC FUSE): 93.750s
  • Enable VirtioFS: 25.461s

That's a 114% speedup, and it makes a huge difference for my PHP development workflows using Docker on my Mac.

And this isn't a synthetic filesystem test benchmark, I tested installing my Drupal codebase three times in each condition, and those are the averages. I do this regularly, and a 4x speedup in this part of the workflow is huge.

Some users have reported issues with file permissions or running git operations from within the container, but since I manage my codebase on the Mac side, and don't do anything too exotic inside the running container, I haven't encountered an issue yet.

So far I'm not sure if similar improvements are on their way for Windows, but this longstanding issue's permanent resolution should bring more users across (even in the midst of some abandoning Docker Desktop because of their licensing changes).


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK