Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)copy! share!
posted in category Systems Software / MacOS
posted at 10. Aug '21

Docker Is Slow on macOS

While macOS (situation in 06/2021) is still a good OS for software development. Sure, you have to accept whatever Apple shove in your throat in Xcode EULA, but still.

However having multiple applications in Docker is very slow and therefore frustrating. So slow I avoided running full test suite locally as it took like 40 minutes. Since I was used to macOS, I was reluctant to switch operating system. Spent shitload of time searching for solutions, but everything which sped up IO was half assed. Later I had to run multiple Ruby on Rails applications instead of just 2 and everything got really slow and my frustration hit highest level I can imagine and was considering quitting the job. In the end I just switched to openSuse Linux and Dell laptop. Docker on Linux is very fast. I felt relief and happiness after a very long time. I hate waiting, especially when there is not much reason.

Docker app on macOS used to use VirtualBox, so it created a virtual linux machine to use cgroups and other stuff. That means losing quite lot of performance. Then they switched in 2020, I think, to Hyperkit and in 2021 to Virtualization. But even Virtualization framework from Apple was slow. Sure, it was in experimental phase, but I didn’t have any patience left since I realized how much of my life I was wasting.

Macbook Pro was from 2020, i5, 32GB of RAM. Linux - Tuxedo with 9xxx Intel and 16GB of RAM. Windows - not sure, some mid end laptop.

Some data running one specific spec file from Ruby on Rails application (second run - it was a request spec, to be sure Webpacker files are compiled).

bash Docker running on Linux in QEMU: 17,86 (9,03 s to load) macOS: 3 minutes 39.7 seconds (files took 9.52 seconds to load) Windows+WSL2+Ubuntu+Docker: 16.72 s (7.81 to load)

Testing IO (read):

bash Docker running on Linux in QEMU: IOPS=29.6k, BW=116MiB/s macOS: IOPS=10.4k, BW=40.5MiB/s Windows+WSL2+Ubuntu+Docker: ???

As you can see, the difference is stark. Maybe Apple will get it working, but so far it was too little, too late.

Add Comment