Cover Image for docker-sync performance test

docker-sync performance test

I use Docker for all of my Magento2 (and most other things) development. I've created a repository that I maintain on GitHub with the configurations that I use.

https://github.com/willwright/docker-magento2

Recently a colleague of mine showed me docker-sync and I wanted to try it out see if it could improve the performance of my local development.

http://docker-sync.io/

Results

Test AVG Load Time (s)
No Cache 87.6
Redis Cache 42.37
docker-sync - Current - No Cache 36.93
docker-sync - Current - Redis Cache 33.14
docker-sync - App - Redis Cache 33.52

Performance test results graph

As you can see the way that the environment is setup can make a big difference.

Methodology

General

  • Macbook Pro
  • OS 10.15.1 (19B88)
  • 2.4 GHz 8-Core Intel Core i9
  • 32 GB 2400 MHz DDR4
  • Firefox 71.0
  • Elasticsearch enabled
  • Default Magento2 Enterprise (2.3.3)
  • Page used to test load time was always the homepage.

Page used to test load time was always the homepage.


No Cache

Redis running but not configured in env.php

docker-compose stop
docker-compose down
docker-compose up
docker exec -it local-magento2ee_web_1 bash
. reset.sh

Load Homepage Repeat for 10 samples


Redis Cache

Redis running and configured in env.php

docker-compose stop
docker-compose down
docker-compose up
docker exec -it local-magento2ee_web_1 bash
. reset.sh

Load Homepage Repeat for 10 samples


docker-sync - Current - No Cache

Redis running but not configured in env.php

docker-sync syncing entire application directory to /var/www/html/current

Unison sync strategy

docker-compose stop
docker-compose down
docker-compose up
docker exec -it local-magento2ee_web_1 bash
. reset.sh

Load Homepage Repeat for 10 samples


docker-sync - Current - Redis Cache

Redis running and configured in env.php

docker-sync syncing entire application directory to /var/www/html/current

Unison sync strategy

docker-compose stop
docker-compose down
docker-compose up
docker exec -it local-magento2ee_web_1 bash
. reset.sh

Load Homepage Repeat for 10 samples


docker-sync - App - Redis Cache

Redis running and configured in env.php

docker-sync syncing only app directory to /var/www/html/current/app

Unison sync strategy

docker-compose stop
docker-compose down
docker-compose up
docker exec -it local-magento2ee_web_1 bash
. reset.sh

Load Homepage Repeat for 10 samples

Resources

reset.sh

#!bin/bash
rm -rf generated/code/*
rm -rf pub/static/frontend/*
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf var/view_preprocessed/*
magento cache:flush