DEV Community

Kiet Nguyen
Kiet Nguyen

Posted on

docker-sync performance in Apple M1

Syncing by docker-sync is still faster than running by native (out of the box)

Setup

Hardware

  • Apple M1 Pro
  • 32GB
  • Monterey
  • "Enable VirtioFS accelerated directory sharing" experimental feature is checked

Docker for Mac (only)

  • Version: 4.9.1 (81317)
  • Memory: 8GB
  • CPUs: 5

Results

Native

docker run -it -v /tmp:/var/www alpine time dd if=/dev/zero of=/var/www/test.dat bs=1024 count=100000
100000+0 records in
100000+0 records out
real    0m 9.31s
user    0m 0.25s
sys     0m 3.91s
Enter fullscreen mode Exit fullscreen mode

Docker-sync - Strategy: native_osx

git clone https://github.com/EugenMayer/docker-sync-boilerplate
cd docker-sync-boilerplate/default
# Set a custom image in docker-sync.yml
#    appcode-native-osx-sync:
# +    native_osx_image: eugenmayer/unison:2.51.3-4.12.0-ARM64
docker-sync-stack start
Enter fullscreen mode Exit fullscreen mode
docker exec -it default-app-native-osx-1 time dd if=/dev/zero of=/var/www/test.dat bs=1024 count=100000
100000+0 records in
100000+0 records out
real    0m 0.35s
user    0m 0.03s
sys     0m 0.31s
Enter fullscreen mode Exit fullscreen mode

Docker-Sync - Strategy: Unison

git clone https://github.com/EugenMayer/docker-sync-boilerplate
cd docker-sync-boilerplate/unison
# Set a custom image in docker-sync.yml
#    appcode-unison-sync: # tip: add -sync and you keep consistent names as a convention
#      src: './app'
#      sync_strategy: 'unison'
# +    unison_image: eugenmayer/unison:2.51.3-4.12.0-ARM64
docker-sync-stack start
Enter fullscreen mode Exit fullscreen mode
docker exec -it unison-app-unison-1 time dd if=/dev/zero of=/var/www/test.dat bs=1024 count=100000
100000+0 records in
100000+0 records out
real    0m 0.31s
user    0m 0.03s
sys     0m 0.28s
Enter fullscreen mode Exit fullscreen mode

References

Top comments (0)