-
Notifications
You must be signed in to change notification settings - Fork 269
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
[Docker Desktop] Improve Mac File system performance #7
Comments
These issue are still happening, so can they be added to this or new cards made to include them? |
I hope leaving a note here is not unwelcome to highlight a particular difficulty in booting Rails applications in Docker on macOS. Between Rails hot code reloading, which has a semi-hard dependency on working filesystem events (the polling alternative can eat as much as 20% of system CPU) and Bootsnap, which is a caching loader which tries to speed up booting Rails by bypassing the parsing step (and caching compiled btyecode on disk) which means that booting a Rails app with bootsnap loaded writes as many file as it reads (sometimes), but other times (e,g warm start) has a very different read/write ratio. None of the existing methods account for this very well, even the relatively new mount options to try and performance boost either reads or writes don't particularly help because of the relative symmetry under certain configurations. Most places I know are still using NFS, with polling, and trying to tune the fsattr cache times to get a reasonable balance of developer experience (speed of code reloading) vs. performance (outright speed), but it's a tightrope. |
hey @daveisfera we haven't got this quite out onto edge yet :) once we do we will move this over to developer/preview and update this ticket. Hopefully then people on those tickets should see some movement! |
@nebuk89 could u clarify caching? Because at the moment the problem is the slow sync from host machine to docker containers |
@mauri-brioschi With PHP/Symfony apps sometimes the reverse happens: the app itself rewrites a bunch of files in its own |
@Jean85 i know the problem and it happens more with "Frameworks" like Magento where there is "generated" code. Usually i exclude these directories so there's not need for sync. |
Artifacts and caching directories like Mutagen offers different modes https://mutagen.io/documentation/synchronization and ideally we should have access to all of these modes. I believe the "one way" is more performant than "two way" since it only needs to check the filesystem changes in one direction. We'd also need to control whether the host or container is alpha or beta. Consistency also probably isn't required for these artifacts directories, it just needs to be "generally there". Being able to control volume mounts on these different modes is crucial to achieving maximum performance. |
What's about mounting NFS volumes? It is the only working solution i have found, i.e. for Magento2. |
@mauri-brioschi osxfs is (much) more performant than nfs in my experience. i haven't had any issues with osxfs as long as i am strategic in the volumes i mount. |
I'd like to add that in our case it is important to not sync folders like node_modules or Elixirs build and deps folders back to the host especially because of IDE support. Elixirs folders contain architecture-specific compiled files that will break IDE functionality because many plugins need to execute these files. While file system performance is one of our most prominent Docker dev issues, the requirement of being able to exclude folders from syncing is very important too. The obvious workaround would be to simply mount another volume on top of the shared app volume for node_modules and such, but we encountered strange issues with that too. There are filed issues for those problems, but I can't find them right now. I think the issue was the the volumes for node_modules and so on suddenly didn't mount anymore. |
Just a note that all the docker-sync approaches we've tried have failed, and I'd be very suspicious of mutagen. Although the performance was great, the reliability was zero. |
@markshust i'm following this issue docker/for-mac#1592 since a while, and NFS is definitely not slower than Osxfs... we are using it in all Magento2 projects and performances are not comparable at all. We save minutes with NFS. |
@mauri-brioschi it depends on what you're using it for. For PHP projects that all have a zillion tiny files that need to be read every time you send a request, osxfs is definitely not as good. IIRC, for small numbers of files, it does pretty well. |
We've tried mutagen on macOS and it worked well but we've experienced syncing issues with Windows. Eventually, we chose not to use mutagen in our team since the difference in setups between Windows and macOS slowed us down more (in terms of maintenance) than a less performant "delegated" mode. Hopefully, a native integration will make this as simple as adding a flag to your volume. |
I'm very excited to have a native implementation of Mutagen within Docker Desktop, as my company and I have been using it for over a year! We are working on both Magento and Symfony, so we are heavily impacted by the famous file system performance issues... We tried several approaches (Docker Machine NFS, docker-sync, exclude cache/vendors from synchronization, etc.), but the most successful by far is Mutagen, at least for us. Although having to use a third party solution in addition to Docker is still an issue from my point of view. |
This is exactly the experience we want! You should be able to check a volume in the Desktop settings and get it cached :) Initially this will just be released on Mac (as our first preview) due to the point some of you have highlighted that behaviour in Windows differs. Our end goal is to ideally hide this difference so it 'just works with a check box'. |
This is now out on Docker Desktop Edge, we are after feedback on the UX, the functionality and the performance! |
For those of you having permission issues since switching to Edge there's an issue here: |
@jasonwilliams acknowledged, Dave has looked at the issue and we are looking :) |
Hi @TomasLudvik, would you mind giving this builds a try? For Intel https://desktop-stage.docker.com/mac/main/amd64/128006/Docker.dmg |
@lorenrh @djs55 @dgageot providing the context you have requested. By the way, my entire company is running out of the 4.14.1 release, as that is the only stable performant release. We are now exploring alternative products, as we have been waiting for a solution nearly a year at this point. As you can see below: @thatJeztah mentioned a fix implemented for a permission issue on 4.14.1 which is the source of all issues apparently: First user @o1y reporting the performance issues after 4.14.1 on 4.15.0: User @o1y benchmark 4 reactions: @kalifg benchmark 7 reactions: @paolomainardi benchmark 2 reactions: @fredericdalleau providing context to the issue: @KPiccoloDaimao benchmark 5 reactions: @dkechag benchmark 4 reactions: @fredericdalleau providing context and a new release in an attempt to improve it: @KPiccoloDaimao benchmark after attempt to improve it by @fredericdalleau: @dkechag benchmark 2 reactions: @thaJeztah providing a possible solution that never rolled out: @mj3c mentioning the impact of this performance degradation since 4.14.1 18 reactions: |
Hello, |
Hello,
We have a large local Docker setup with several containers and bind mounts... We tried Orbstack but no improvements. The simplest solution I see now is downgrading to a previous version that would provide better perfs. The oldest available is 4.18.0. How can I download previous releases ? Or maybe a beta version with big performance improvements ? |
I am sorry, but we are busy at work so I cannot test every release until it is proven to be better as it takes me at least an hour to switch to the new release, test it, and switch back.
@franck-grenier https://desktop.docker.com/mac/main/arm64/91661/Docker.dmg it is the arm version. |
Hi @smnovick Just wondering if there was any further progress with the Mutagen integration work mentioned above? We signed up for the developer preview back in mid-November to help test and provide feedback but we have not been accepted into the program yet. |
I have been following this topic for more than 1 year. I recently replaced my I just would like to share that with you. |
@edmarriner Thanks for your interest - we had a lot of interest in the preview and chose to limit the number of participants in order to optimize feedback. We are planning on releasing the functionality in the 4.27 release at the end of the month, and will share more information at that time. |
As per https://docs.docker.com/desktop/synchronized-file-sharing/
Nice, we have to pay for a basic thing to just work, the file system to not be slow in docker on mac. |
|
Could it be a mistake in the documentation ? |
Huh. This was not what I was expecting.
From my perspective hose directories are very important to make available both in the container and host. In multiple containers (e.g. cron and frontend) for execution, and in the host so that the IDE can detect classes for code autocomplete and ilntellisense-style help. It seems the new, fourth way, to share files in Docker is still not a good help for Composer-based PHP projects, or am I thinking abut this wrongly? |
Hi @NiklasBr, if those directories are critical to your workflow, then there's no need to ignore them. We only recommend excluding them if you don't need them and you want to save space within the VM (since they'll be duplicated there when synced). We actually hope this functionality will be particularly effective for PHP projects, so by all means feel free to include their dependencies in the sync! |
Because you recommend ignoring those directories, what use cases would they be ignored in? I can't find any description on how to deal with multiple projects side by side using |
Hi again @NiklasBr, great question! It's typically useful to ignore files via For example, you might have graphic assets (such as Another case would be where you have dependencies that include native code (e.g. In general, however, if you need to synchronize the dependencies directories (be they from I'm not sure exactly what you mean with regard to the side-by-side projects using We're still collecting feedback on this functionality, so if there's a mechanism that would be easier for enabling this (such as Compose integration, CLI control, etc.), please feel free to provide your feedback! |
We pretty much need to be able to do this automatically, manually is too fraught with issues and time-consuming. Consider this (simplified version) of our project folder structure with three side-by-side projects:
These have separate Composer and Node dependencies and are wholly separate customer projects with their own docker images and own repositories. One might work on project_foo one day and the next day project_baz and the next week project_bar. Some projects may be ElasticSearch, some may not, others may need a frontend pre-renderer, other may not, some projects may use Vue, others React... While they are often built on the same basic tech stack, and have a standardised folder structure and standardised docker volumes in their compose files they may wildy differ in the versions of dependencies, they cannot in reality share any data such as the vendor and node_modules or sync in-between one another. The need to set up shares quickly without manual steps either via configuration via docker-compose.yaml or at lease an installation script is doubly important for our colleagues in the support department who need more than I to quickly juggle between a lot of different projects to respond to customer needs. |
Thanks for the clarification. I think the best suggestion I can offer at the moment would be to create a Synchronized File Share for With regard to future automation and/or Compose integration, I don't have anything I can share or promise at the moment, but this is definitely something we'll be looking into, so please do keep an eye on future releases. |
Thanks @xenoscopic I'll try it as soon as I can find a solution for this issue docker/for-mac#6956 (comment) right now I have to go back to 4.26.1 |
macbook pro 16, i9 + 32GB Ram, amd radeon 5500m + 2 external monitors + Docker with VirtioFS. After upgrading Docker to one of the recent versions (I don't know exactly which one introduced the issue), my fans are going up to 5600 rpm all the time when containers are up. It's uncomfortable to work in a loud office and feel like on the airport. I downgraded Docker to recommended here 4.14.1 and it's way better. Now my fans go to 5600 rpm only when I use and put a load on my containers, but in the idle fans go down to 3500-4000 rpm. |
We have completed our integration of the Mutagen plugin with Docker Desktop and released it as Synchronized File Shares in Docker Desktop 4.27. You can read more here: https://www.docker.com/blog/announcing-synchronized-file-shares/ Given the original request here was to "Integrate the mutagen plugin with Docker Desktop", we will be closing this issue. |
Update Feb 6, 2024 - Released as part of Docker Desktop 4.27 - https://www.docker.com/blog/announcing-synchronized-file-shares/
Update Nov 9, 2023 - As announced in June, Docker has acquired Mutagen IO, Inc.. We are hard at work integrating it into Docker Desktop and working to roll it out as part of a limited early access program.
Update: we are now looking at using GRPCFuse rather than mutagen as a simpler path for perf improvement.
Tell us about your request
Integrate the mutagen pluggin within Docker Desktop to provide users with a file caching option to improve performance on modern web frameworks like PHP Symphony
Which service(s) is this request for?
Desktop
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
File system performance is big issue on Mac,our goal improve web page refresh for web languages like PHP from 2.8 seconds to 0.2 seconds
Are you currently working around this issue?
N/A
Additional context
N/A
Attachments
docker/for-mac#77
The text was updated successfully, but these errors were encountered: