0

Has anyone been able to solve the filesystem performance issues with mounted volumes on OSX?

I’m running time du -d0 in some directory, and my baseline (on the host) is this:

> time du -d0
117496  .
________________________________________________________
Executed in   87.45 millis    fish           external
   usr time    7.43 millis   88.00 micros    7.34 millis
   sys time   75.34 millis  735.00 micros   74.60 millis

When doing that inside a container, on a mounted volume:

> docker run -ti --rm -v $PWD:$PWD -w $PWD alpine:3.11 time du -d0
58748   .
real    0m 6.42s
user    0m 0.06s
sys 0m 0.29s

After reading this, I also tried the :cached and :delegated options, to no avail:

> docker run -ti --rm -v $PWD:$PWD:cached -w $PWD alpine:3.11 time du -d0
58748   .
real    0m 6.09s
user    0m 0.06s
sys 0m 0.36s
> docker run -ti --rm -v $PWD:$PWD:delegated -w $PWD alpine:3.11 time du -d0
58748   .
real    0m 5.28s
user    0m 0.06s
sys 0m 0.49s

Tested on: macOS Catalina 10.15.6 Docker desktop 2.3.0.4 Docker engine: 19.03.12

benzaita
  • 12,869
  • 3
  • 20
  • 22
  • This is a pretty well-known and [documented](https://docs.docker.com/docker-for-mac/osxfs/#performance-issues-solutions-and-roadmap) issue. If you need to manipulate large amounts of data on the host or you need a live development environment, native tooling (maybe using a package manager like Homebrew) will be a better match. – David Maze Sep 04 '20 at 13:31
  • I am aware of that page (as linked in my question). My question is why the instructions there don't seem to solve the problem. – benzaita Sep 04 '20 at 13:51
  • Also, I am aware of third-party tools (like docker-sync). But the official docs say that `:delegated` and `:cached` should solve this, without any 3rd party tool. – benzaita Sep 04 '20 at 13:53

0 Answers0