for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

File access in mounted volumes extremely slow

Open schmunk42 opened this issue 10 years ago • 212 comments

continued from https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076/178

Expected behavior

File-system performance in the container not significantly slower than on the host or docker-machine.

Actual behavior

Running a composer (PHP) update in a container takes much longer than on the host. In the container we usually hit timeouts when updating huge git repos like twbs/bootstrap.

Information & Steps to reproduce the behavior

See link above

schmunk42 avatar Aug 02 '16 18:08 schmunk42

Same for npm install, bundle install, browserify, etc.

Vanuan avatar Sep 04 '16 10:09 Vanuan

Hi

Ok, that's why a Symfony application is very slow in a Docker container! I load a page in ~ 150 ms when I'm running my local Symfony server (on my host) VS ~ 2000 ms when the config files have been serialized in the cache directory within a Docker container. It seems the IO in the vendors and the cache / logs directories are very slow...

cyb3rd4d avatar Sep 05 '16 09:09 cyb3rd4d

Same here with rails and its friends (rails, rake, rspec...)

Please let me know what information I can provide to help you guys out.

lfv89 avatar Sep 06 '16 20:09 lfv89

Same here as well. We're looking into using IntelliJ IDEA and git on the Mac and compiling & running our product in a container, from the shared filesystem. Development cycles are considerably longer and our devs not happy with the proposed switch. Currently evaluating workarounds to still enable the switch to Docker and in particular Docker for Mac.

mduller avatar Sep 07 '16 07:09 mduller

For those who look for a workaround and didn't read the whole thread, here is the solution : https://github.com/EugenMayer/docker-sync

wadjeroudi avatar Sep 07 '16 08:09 wadjeroudi

Same with PHP (Symfony, Nette, Composer deps...). I can confirm https://github.com/EugenMayer/docker-sync is usable workaround.

ZZromanZZ avatar Sep 07 '16 19:09 ZZromanZZ

We're experiencing this as well. We have our API dockerized and sometimes endpoints time out on our local machines (only in docker for mac). We're using Rails 5.

iwaffles avatar Sep 08 '16 16:09 iwaffles

In my team, some developers use a Mac, others use Linux... Docker sync is not the solution for me because the project configuration will not be the same for all environments. I hope that the OSXFS issues will be fixed quickly.

cyb3rd4d avatar Sep 09 '16 08:09 cyb3rd4d

@MartialGeek Off topic : https://github.com/EugenMayer/docker-sync/wiki/Keep-you-docker-compose.yml-portable But you should create a makefile to handle the environment properly.

wadjeroudi avatar Sep 09 '16 13:09 wadjeroudi

@wadjeroudi Thank you, I will read that ASAP ;)

cyb3rd4d avatar Sep 09 '16 14:09 cyb3rd4d

Same issue here, takes +30 sec to run my babel build using a mounted volume vs. 5 sec using container's fs.

petergombos avatar Sep 13 '16 12:09 petergombos

👍 Same issue with Git in docker, very slow ! Unusable compare to Docker Machine (with NFS) Docker For Mac released too fast ! Need to be reviews !!!

jsamouh avatar Sep 14 '16 08:09 jsamouh

Whole team is having issues with Magento, 3 minute page loads vs 8 seconds using docker-sync

jzahedieh avatar Sep 14 '16 16:09 jzahedieh

I'm also experiencing this issue. Hitting the cache takes no less than 1 second for each file.

BenMcH avatar Sep 15 '16 20:09 BenMcH

Will this issue eventually be addressed?

apahne avatar Sep 17 '16 06:09 apahne

Here's the latest reply from Docker Team: https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076/158

It's been quite a while since then. We all hope that they have something new to share.

Vanuan avatar Sep 17 '16 06:09 Vanuan

Just checked on latest Docker for Mac update : Version 1.12.1 (build: 12133)

seems to be still an issue.

joemewes avatar Sep 17 '16 12:09 joemewes

Latest posts on the alternatives are interesting - https://forums.docker.com/t/alternatives-to-osxfs-performant-shares-under-osx/19565/14 - which points to https://github.com/cweagans/docker-bg-sync (minimal changes to compose file for developer allow a significant speed improvement for mounted source files)

so0k avatar Sep 19 '16 11:09 so0k

Yeah, I've gone the UNISON approach (also mentioned a couple times in the original thread) : see here https://github.com/4AllDigital/DockerDrupal-lite/blob/master/docker-compose.yml#L7

using this container : https://github.com/4AllDigital/drupaldev-unison

if anyone needs an example to copy and want to use UNISON too.

joemewes avatar Sep 19 '16 11:09 joemewes

Same issue with Magento. Major performance issues. We are moving to Unison now as well.

piotrekkaminski avatar Sep 21 '16 14:09 piotrekkaminski