Unfortunately, having the same problem, application is unusable cause it runs all commands very slow. When i used docker-machine on mac, i manually mounted shared volume via nfsd and it fixed the problem. I use docker-compose to build everything like this:
data:
...
volumes:
- .:/var/www
And run it like: docker-compose up -d.
I hope this problem will be fixed in the future releases. for now have to switch back to docker-machine.
Why are most of you all switching back to docker-machine / dockertoolbox due to this issue?
The issue with docker-mac-dev and sorts are, they make to many assumptions (like forcing to user VirtualBox). But this is not needed
For this issue to be fixed no matter you use docker-machine (virtualbox or fusion or paralells) or docker for mac, simply:
If you want to resync on changes automatically, use Filewatcher ( shell or ruby gem, what suits you best ) and thats basically it. This way, you are independent of the solution like VirtualBox, Fusion or docker for mac.
This solution is 2 times faster as NFS is.
Rsync with docker for mac is pretty nice, at least for my purpose. Though, i hope they fix this natively to remove rsync as an extra-dependency to the stack
Version 1.11.1-beta11 (build: 6974)
37559e5f6acd56a4810963acc7001e88f2d88017
sh-4.1# time dd if=/dev/zero of=test.dat bs=1024 count=100000
100000+0 records in
100000+0 records out
102400000 bytes (102 MB) copied, 26.5737 s, 3.9 MB/s
real 0m26.579s
user 0m0.190s
sys 0m1.630s
Was excited to join the beta today because of this:
“Volume mounting for your code and data: volume mounting and data access just works, including file change notifications (on Mac inotify now works seamlessly inside containers for volume mounted directories). This enables edit/test cycles for “in container” development.”
Not so excited after trying the beta because of the slow mounted volumes.
As shown in my last posts this is due to the vendors (much more than shared cache and logs folders to my surprise). So for now I move the vendor directory out of the shared directories.
I wish I could develop Symfony apps normally using Docker too!
Hi @michaelperrin & @davidcrty yup, moving vendor dir out of shared dirs is an improvement (through a docker named volume it’s pretty cool for local dev if you plan tu run multiple instances of the same container).
But… even with that I can say that my behat test suite is about 4 times slower than on a virtualbox docker machine with some NFS mount.
Version 1.11.1-beta12 (build: 7528)
4151b0fc71e51fb8e551d0a1870893ac99a379bc
sh-4.1# time dd if=/dev/zero of=test.dat bs=1024 count=100000
100000+0 records in
100000+0 records out
102400000 bytes (102 MB) copied, 25.1831 s, 4.1 MB/s
real 0m25.188s
user 0m0.140s
sys 0m2.150s
Haven’t run specific tests but have still found beta12 to be extremely slow with mounted volumes. To the point where I’ve stopped using it, think I’ll retry with each new release and stick with alternatives until then.
OS X: version 10.11.4 (build: 15E65)
Docker.app: version v1.11.1-beta12
Running diagnostic tests:
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160518-222735.tar.gz
Most specific failure is: No error was detected
time dd if=/dev/zero of=/var/www/test.dat bs=1024 count=100000
100000+0 records in
100000+0 records out
real 0m 32.85s
user 0m 0.22s
sys 0m 2.13s
Not only the file access is slow but you can also definitely spot a change on frameworks using lots of files to render pages.
For example, a Magento run with a Apache + PHP - FPM + Percona stack is visually way lot slower on page load when the folder are mounted on the host VS when the folder is only stored as a Volume in the VM.
AB benchmark comparison:
With mounted folders:
$ ab -n10 -c10 http://magento.dev/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking magento.dev (be patient).....done
Server Software:
Server Hostname: magento.dev
Server Port: 80
Document Path: /
Document Length: 0 bytes
Concurrency Level: 10
Time taken for tests: 31.205 seconds
Complete requests: 10
Failed requests: 7
(Connect: 0, Receive: 0, Length: 7, Exceptions: 0)
Total transferred: 235984 bytes
HTML transferred: 232603 bytes
Requests per second: 0.32 [#/sec] (mean)
Time per request: 31204.892 [ms] (mean)
Time per request: 3120.489 [ms] (mean, across all concurrent requests)
Transfer rate: 7.39 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.1 1 1
Processing: 2 17343 12491.7 23129 31203
Waiting: 0 17340 12491.0 23127 31195
Total: 3 17343 12491.8 23129 31204
Percentage of the requests served within a certain time (ms)
50% 23129
66% 23259
75% 24196
80% 30541
90% 31204
95% 31204
98% 31204
99% 31204
100% 31204 (longest request)
With volume only on the VM:
$ ab -n10 -c10 http://magento.dev/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking magento.dev (be patient).....done
Server Software: Apache/2.4.20
Server Hostname: magento.dev
Server Port: 80
Document Path: /
Document Length: 33229 bytes
Concurrency Level: 10
Time taken for tests: 1.605 seconds
Complete requests: 10
Failed requests: 0
Total transferred: 337120 bytes
HTML transferred: 332290 bytes
Requests per second: 6.23 [#/sec] (mean)
Time per request: 1605.108 [ms] (mean)
Time per request: 160.511 [ms] (mean, across all concurrent requests)
Transfer rate: 205.11 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 1
Processing: 396 952 451.4 952 1604
Waiting: 394 951 451.2 951 1604
Total: 396 953 451.4 952 1605
Percentage of the requests served within a certain time (ms)
50% 952
66% 1057
75% 1395
80% 1561
90% 1605
95% 1605
98% 1605
99% 1605
100% 1605 (longest request)
That is indeed nearly 25 times quicker without the files mounted on the host if we consider the median time
On OS X: version 10.11.5 (build: 15F34) & Docker.app: version v1.11.1-beta12
I think I can make it better by not including node_modules and tmp folders (it is an ember project). Is there a way to exclude some folders from volumes? (.dockerignore didn’t work)