How to find out what docker slows down?

My problem is this: I have a Docker on OSX with containers containing Redis, NginX, PHP 7, and Unison. When matching with php container, I have scope with Symfony 3.1.7.

Everything works, but on the Welcome page of Symfony, on average ~ 1.5 seconds were downloaded. At the same time, the same setup without docker gives me a boot time of 0.2 seconds. I got the same difference for the Symfony console commands, so I think this is not a problem with NginX, and Unison should have nullified all the problems associated with Docker file synchronization on the OSX problem.

Right now I have run out of ideas on what I can do to speed up the process and how to find out what creates a 1.5 second delay.

I have the same problem on my second MBP, but this does not happen on my colleagues laptop, which is similar to the one I have, but we could not find the difference between the two settings.

Everything works on my MBP with a 2.5 GHz i5, 8 GB RAM and SSD.

Docker 1.12.3, OSX 10.12.1 (Sierra)

docker-compose.yml:

mydockerbox-redis:
  image: phpdockerio/redis:latest
  container_name: mydockerbox-redis

mydockerbox-webserver:
  image: phpdockerio/nginx:latest
  container_name: mydockerbox-webserver
  volumes:
      - ..:/var/www/mydockerbox
      - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
  ports:
   - "80:80"
  links:
   - mydockerbox-php-fpm

unison:  
  image: leighmcculloch/unison:latest  
  environment:  
    - UNISON_WORKING_DIR=/unison  
  volumes:
    - ../mydockerbox:/var/www/mydockerbox
  ports:  
    - "5000:5000"

mydockerbox-php-fpm:
  build: .
  dockerfile: php-fpm/Dockerfile
  container_name: mydockerbox-php-fpm
  volumes_from:  
    - unison  
  volumes:
    - ./php-fpm/php-ini-overrides.ini:/etc/php/7.0/fpm/conf.d/99-overrides.ini
  links:
    - mydockerbox-redis

UPD And here is the Dockerfile for the php-fpm container:

FROM phpdockerio/php7-fpm:latest

# Install selected extensions and other stuff
RUN apt-get update \
    && apt-get -y --no-install-recommends install  php7.0-mongodb php7.0-redis php7.0-igbinary \
    && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*


WORKDIR "/var/www/mydockerbox"
+4
source share
2 answers

I suggest you use docker-machine-driver-xhyve :

docker-machine / libmachine plugin for xhyve / hyperkit ( native macOS hypervisor.framework )

brew (, docker & Co brew, brew!):

brew install docker-machine-driver-xhyve
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

- :

docker-machine create --driver xhyve --xhyve-experimental-nfs-share my-xhyve-docker-machine

0

-, PHP php-fpm ( , ) .

, /, PHP, , Symfony 1,5 " ". , ( , Redis, DNS ..).

, PHP (, , ), -. - php-fpm contaner - , .

0

Source: https://habr.com/ru/post/1662081/


All Articles