Running Discourse on Docker for Mac

Following:

Doing dev work in docker on a mac may be workable!

Rails Boot Slowdown
Host 5.64
Virtual Box 6.15 9%
Virtual Box + Docker 8.78 55%
Docker Mac (cached) 11.2 98%
Docker Mac (uncached) 15.7 178%

Note: for Docker setup on virtual box has gems are in AUFS and working directory in a mounted volume. On mac the working directory is a cache mounted volume. It is likely performance would improve if overlay was used or gems are mounted on the host to avoid virtualized file system.

Docker for Mac … uncached:

sams-MBP:discourse sam$ time d/rails r 'puts'


real	0m19.035s
user	0m0.016s
sys	0m0.014s
sams-MBP:discourse sam$ time d/rails r 'puts'


real	0m15.702s
user	0m0.017s
sys	0m0.014s
sams-MBP:discourse sam$ time d/rails r 'puts'


real	0m17.290s
user	0m0.016s
sys	0m0.011s

Docker for mac … cached

sams-MBP:discourse sam$ time d/rails r 'puts'


real	0m11.430s
user	0m0.018s
sys	0m0.012s
sams-MBP:discourse sam$ time d/rails r 'puts'


real	0m11.293s
user	0m0.019s
sys	0m0.012s
sams-MBP:discourse sam$ time d/rails r 'puts'


real	0m11.995s
user	0m0.017s
sys	0m0.012s

Ruby installed on host

sams-MBP:discourse sam$ time bin/rails r 'puts'


real	0m7.204s
user	0m4.541s
sys	0m1.780s
sams-MBP:discourse sam$ time bin/rails r 'puts'


real	0m5.644s
user	0m4.319s
sys	0m1.254s
sams-MBP:discourse sam$ time bin/rails r 'puts'


real	0m5.646s
user	0m4.329s
sys	0m1.256s

VirtualBox + docker on the same host

sam@ubuntu:~/Source/discourse$ time d/rails r 'puts'


real	0m12.519s
user	0m0.016s
sys	0m0.012s
sam@ubuntu:~/Source/discourse$ time d/rails r 'puts'


real	0m8.786s
user	0m0.016s
sys	0m0.000s
sam@ubuntu:~/Source/discourse$ time d/rails r 'puts'


real	0m8.733s
user	0m0.008s
sys	0m0.004s

VirtualBox, no docker

real	0m9.386s
user	0m5.332s
sys	0m1.692s
sam@ubuntu:~/Source/discourse$ time bin/rails r 'puts'


real	0m6.032s
user	0m4.796s
sys	0m1.116s
sam@ubuntu:~/Source/discourse$ time bin/rails r 'puts'


real	0m6.155s
user	0m4.924s
sys	0m1.104s
sam@ubuntu:~/Source/discourse$ time bin/rails r 'puts'


real	0m6.112s
user	0m4.804s
sys	0m1.180s

9 Likes