-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File system performance improvements #1592
Comments
A rudimentary real-worked example (Drupal 8): Docker for Mac : Version 17.05.0-ce-rc1-mac8 (16582) A simple command line curl test (taken average of 10 calls to URL) Drupal 8 clean install frontend: old UNISON (custom synced container approach) Volume mount : v.easy implementation to add to my compose.yaml files and happy with any delay between host/output using cached on host codebase. @yallop Is there a rough/expected release date for 17.04 (stable) ? |
The next stable version will be 17.06, and is likely to be released some time in June. There's been a change to the Docker version numbering scheme recently so that the numbers now indicate the release date, with stable releases every three months (March, June, September, December), and edge releases in the months in between. For example, 17.04 is the Edge release in April 2017 and 17.06 is the stable release in June 2017. |
ok, thanks for that. do you expect 17.06 to contain at least the current edge implementation of :cached? |
Yes, that's the plan. |
How should this work in a
... but that got me an error (on OSX):
(Docker version 17.05.0-ce-rc1, build 2878a85) Note: having a global setting or environment variable to switch my local default to "cached" would also be fine (or rather preferable). |
The syntax looks correct @reinout
tested on |
Your example works. My own one still not (even after really making sure there were no left-over old mounted volumes). So I rebooted. Afterwards, it worked. So: a reboot might be needed if you've run a docker-compose before upgrading docker to the latest version. Possibly related: I switched from docker stable to edge. Is there a possibility of a global setting? I don't really want to add this option to the |
not as far as I know. When you linux colleagues are running edge the flag should work. Another workaround would be (that's what we do right now for separating linux and mac volume mounting ) |
@reinout You could use an additional compose file to override that of your colleagues? For instance, we have: docker-compose.yml:
and volumes-cached.yml:
Which can be run with:
|
Yes, I could do that. But.... I'd have to do that for each of the 12 docker-compose projects. And I'd have to keep it in sync with changes to the "master" As an intermediary measure: fine. Long term: no, as it is not very don't-repeat-yourself :-) If someone wants to enable the "cached" behaviour, that person probably wants to use it for all/most of the dockers. Would it make sense as a config setting in the Docker app itself? In the preferences' "File sharing" tab? (This should probably be its own ticket, I assume?) |
@reinout: |
Provided that everybody uses the latest edge version, right? And it seems a bit strange to add an option that only has effect on osx to everybody's docker-compose.yml. Anyway, it works for now. I won't drag the signal/noise ratio further down :-) |
Perhaps my expectations on how this works are unreasonable, or I'm doing something wrong. Above are some simple disk performance tests and I'm not seeing any differences. Would be interested in knowing if my expectations, or use of the flag is incorrect. |
@matthewjosephtaylor ... :cached won't improve dd tests ... for this, you need to check for :delegated to rollout :) |
The issue text says:
Does this mean that if I were to use In other words, to make my question clearer, let's say I have a codebase in a directory and I mount this directory inside a container using What I understood until now was, that using for instance |
Just posting another data point:
Drupal 8 is ~18x faster if you're using a Docker volume to share a host codebase into a container, and it's pretty close to native filesystem performance. With |
I'm seeing good results for running a set of Behat tests on a Drupal 7 site: On Mac OS, without
With
On Travis CI (without
On Travis CI (with
Nice work, Docker team! 👏 |
Is it expected that both |
@ToonSpinISAAC both @carn1x |
From within a container is there a way to tell which flag was applied for a volume? I'm getting the same output from
|
@lmakarov
|
Thanks for taking the time to clarify and explain @dsheets! |
Is there any indication from the high sierra dev beta of how this (and docker mac in general) will work under APFS? Sorry if this is off-topic but it's a question I keep wanting to ask every time I see a new message here :) |
Unable to get @DanielSchwiperich's example working? Retrieving the error:
It doesn't like |
@WillSquire What version of docker-compose are you using? |
That's been my experience to the point I've had it off for a while now. |
I can confirm the experience of @z1r0-: it does crash with Docker Compose throwing I can also confirm it's not specific to Traefik. In my case it happened on a setup that incorporated Same compose file succeeds on Full failure log:
On a retry, Docker Compose crashes with |
I don't see "Enable VirtioFs accelerated directory sharing". I'm on Monterey with Docker Desktop 4.3.1 (72247). @owsygavin could you please help with that? |
I have an older version than you do: VirtioFS is under experimental features in preferences: |
I suspect what's happened is, due to the big fuss with the log4j CVE, your Docker has been updated, which may have updated to a non-dev-build version. To test this, I hit "Software Updates" -> "Update" and after it came back, my experimental virtuoFS option is gone too: I don't know how to get the docker dev builds; I only got the one linked on this thread, I have no idea how you find "latest Docker dev build with experimental feature support", perhaps a Docker wizard on this thread could advise :-) |
I tried out running
I have the Any pointers please? |
I think I found docker/roadmap#7 (comment) |
We don't have any later dev builds than the one already posted on this thread. |
thanks for clearing that up :-) If you want any future builds testing for this feature, feel free to post on this thread and I can give it a go |
Thanks, we appreciate it. I think we might wait until there is a fix for the |
Hey there, I'm pretty sure some of you are already aware that Apple published a beta version of macOS 12.2. If you feel like updating to a macOS beta version, we would love it if you could retest the build at [link] with the new version of the OS. |
Thank you to everyone who has provided feedback so far on the virtiofs experimental build that was released on 22-November. The latest macOS 12.2 release contains fixes to a number of the issues mentioned in this thread, specifically the Any feedback that you might be able provide on whether the new build + OS update has improved reliability for you would be very helpful as we move towards releasing this within Docker Desktop master as an Experimental Feature. To enable virtiofs accelerated directory sharing please follow these steps:
Virtualization framework performance issues on Intel Please note, there are known performance problems with the new virtualization framework on Intel on Monterey (independent of virtiofs). We've reported it to Apple, and we believe that they're working on it. |
macOS 12.2 was just released. |
Thanks @back-2-95 ! I've now edited my comment from Tuesday to reflect that. |
I've installed MacOS 12.2 and the prototype Docker with these settings It's absolutely crawling, it's so slow it's pretty much unusable with our large PHP application with lots of vendors. Here are the numbers, I don't know how to interpret these runes but it may be of utility to a cleverererr person than me!
I can see that it's using virtiofs:
|
Thanks, @owsygavin. There are known performance problems with the new virtualization framework on Intel on Monterey (independent of virtiofs). We've reported it to Apple, and I believe they're working on it. (@christophermclellan It could be worth adding that to your earlier message too, we've had a few people report it). |
I am running an integration test suite against dependencies (MySQL and Redis) which live in Docker. With MySQL and Redis running on the host, this suite takes approximately 2-3s, the same amount of time it takes on Linux with Docker dependencies. With Docker for Mac, it takes roughly 12-13s. With the experimental build above, and both features enabled, on 12.2 w/ M1 Pro, it takes 75.5s. |
In keeping with the trend in this thread, I ran the following benchmark. w/ experimental features:
I then tried to disable the experimental features by unchecking the top checkbox ("Use the new Virtualization framework"), which grayed out the bottom one ("Enable VirtioFS accelerated directory sharing") but left it checked. I hit save and Docker for Mac has hung ever since. Restarting results in it hanging with the message "Docker Desktop starting..." None of the troubleshooting options - "Clean / Purge data", "Reset to factory defaults", and "Uninstall" - appear to be responsive. I downloaded and installed the stable version of Docker for Mac, and the issue persists. Since it's still starting I am unable to modify any settings to try unchecking both checkboxes. edit w/o experimental features:
|
Which describes the issue I also had. docker/roadmap#7 (comment) |
FWIW I was able to resolve the issue by deleting various Docker directories out of the ~/Library folder and /usr/lib/docker. |
@johnmaguire sorry for the inconvenience. If anyone gets stuck, they remove the settings file |
Thank you to everyone that has provided feedback on the latest experimental build. Apple have just released the macOS 12.3 beta, in which the known speed problems with the new virtualization framework on Intel + Monterey should now be resolved (for example - the issue that @owsygavin reported here). If those that have previously experienced performance issues on Intel would be willing to try out 12.3 we'd be very appreciative of any feedback. |
Hi, thank you for this amazing work! Performance of bind mount with virtiofs is far better than gRPC-fuse. Now I found that
Environment:
I can provide any further informations if needed! |
@sarisia, that's interesting. I can't reproduce here. Could you share your full command line for starting the container, in case the difference is more subtle? Are there other containers running on this host? |
I usually use VSCode devcontainer, but I've confirmed it can be reproduced
Also, I tested both root and non-root user inside the container and |
any news about new build? 😄 |
Ah yes, sorry, there is a new one at docker/roadmap#7 (comment). We should have posted it here too, that's our mistake. However, as the main conversation is at docker/roadmap#7, I'm actually going to lock this ticket now to keep everything in one place. |
Recent Docker versions (17.04 CE Edge onwards) add additional flags to the
-v
option fordocker run
that make it possible to specify the consistency requirements for a bind-mounted directory. The flags areconsistent
: Full consistency. The container runtime and the host maintain an identical view of the mount at all times. This is the default.cached
: The host's view of the mount is authoritative. There may be delays before updates made on the host are visible within a container.delegated
: The container runtime's view of the mount is authoritative. There may be delays before updates made in a container are visible on the host.In 17.04
cached
is significantly faster thanconsistent
for many workloads. However,delegated
currently behaves identically tocached
. The Docker for Mac team plans to release an improved implementation ofdelegated
in the future, to speed up write-heavy workloads. We also plan to further improve the performance ofcached
andconsistent
.We will post updates relating to Docker for Mac file sharing performance in comments to this issue. Users interested in news about performance improvements should subscribe here.
To keep the signal-to-noise ratio high we will actively moderate this issue, removing off-topic advertisements, etc. Questions about the implementation, the behaviour, and the design are very welcome, as are realistic benchmarks and real-world use cases.
The text was updated successfully, but these errors were encountered: