4 ms·
> Containers/Docker are a great technology, but even on my M1 mac where literally everything else is super speedy, they're really slow. Either you're using Doc
by lloeki 5y ago
> Containers/Docker are a great technology, but even on my M1 mac where literally everything else is super speedy, they're really slow.
Either you're using Docker for Mac which itself is slow on IO mostly due to the macos-linux file share syncing every single fseventsd<->inotify or you end up running intel images on aarch64, which uses non-virtualizing qemu to emulate the foreign CPU (see github.com/tonistigii/binfmt)
I'm using Docker in a Fusion instance, sharing /Users through vmhgfs (which in my tests performs better than DfM shares) and it's plenty fast as long as I stick to native images (intel on intel, aarch64 on arm64) and don't outrageously reach out to the shared dirs (notably DfM shares /tmp by default which is ridiculous)
Container tech on Darwin would bring little in most cases since it would containerize a darwin userland, which, while cool, is probably not what most people want. There's no shortcut from running a Linux kernel in a VM to run a Linux userland on Darwin.
- flatiron 5y agoOr they could do what windows did. Support windows docker for whatever use case that supports (never used it) and creating WSL which has Linux roots deep in the OS. I find WSL docker works great for development. Certainly wouldn’t use it in production.
- lloeki 5y agoWSL2 doesn't have Linux roots deep within Windows anymore, it's literally running a Linux VM with a full kernel under the HyperV hypervisor, so it's exactly like DfM (IIRC save for the fact that Windows then also runs under HyperV with the hypervisor sitting on top, Xen-like, and as is achieved on Xbox, and Linux running side by side instead of being handled by an OS process underneath the main OS)
- ycombinator_acc 5y agoIn my experience it's anything but great. It's so slow and such a huge resource hog might as well run a full on Windows VM.
- neilalexander 5y ago> Either you're using Docker for Mac which itself is slow on IO mostly due to the macos-linux file share syncing every single fseventsd<->inotify If you haven't tried the new VirtioFS accelerated directory sharing in Docker for Mac, it makes a _huge_ difference to I/O performance of mounted volumes.
- lloeki 5y agoAdmittedly I didn't, not the least because I expect it to be at best equal in speed to my current setup, plus my current setup gives me better control on the virtualised OS + memory ballooning of the VM (... and that there are other things with DfM that rub me the wrong way). Nonetheless, I salute the years-long effort from the Docker team on that one.
- drcongo 5y agoI'm using Docker for Mac on an M1 Pro and it's stupidly fast, to the point that my dev environment runs faster than the Intel production servers on some things.
- jjjbokma 5y agoHow well does it handle a large amount of writes to small files (say 1000 files, each about 8KB)? Edit: the static blog generator I wrote [1] takes 11 seconds inside a Ubuntu virtual machine with the directory shared with MacOS on an Mac mini late 2014. Docker, on the same machine, takes 1m13 seconds using gRPC FUSE for file sharing. 1866 HTML files are being generated. [1] https://github.com/john-bokma/tumblelog https://github.com/john-bokma/tumblelog
- drcongo 5y agoI have no idea I'm afraid, I don't work on anything that would ever do something like that. As a real world benchmark, the project I'm working on at the moment (Python / Django) runs the test suite in ~10.2 seconds on my Mac inside Docker, on GitHub CI it takes 35 seconds.
- nicoburns 5y agoI'd be interested to know how quickly that runs natively on your mac.