1

I have a problem with performance of my Dockerized app. I have Windows OS. When I run my app using xampp it takes the page ~1 second to load. When I run it inside of Docker it takes ~5 seconds for the page to load. I tried: 1. Docker 2. Docker Toolbox (which creates VirtualBox linux machine and runs Docker inside of it)

Result are the same. Here is my Docker-compose file:

version: '3'

networks:
  default:
    driver: bridge

services:
  webserver:
    build: ./docker/webserver
    image: yiisoftware/yii2-php:7.3-apache
    ports:
      - "80:80"
      - "443:443"
    networks:
      - default
    volumes:
      - /aaa:/var/www/html
    links:
      - db:mysql
    environment:
      MYSQL_PORT_3306_TCP_ADDR: db

  db:
    image: mysql:5.7
    ports: 
      - "3306:3306"
    networks:
      - default
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=pass
      - MYSQL_DATABASE=aaa

Can anybody give me a hint how to fix this? Or this is a regular behavior on Windows pc? Thank you.

Volodymyr
  • 1,557
  • 2
  • 14
  • 21
  • 1
    Have you run a profiler or a similar tool to try to find out what parts of this system are slow, or have different performance characteristics under Docker? – David Maze Apr 19 '19 at 00:57

1 Answers1

1

The reason was that there was no APCU inside of the container. And without the cache code was 20 times slowlier. Always check if you need all necessary libs and modules inside of your containers!

Volodymyr
  • 1,557
  • 2
  • 14
  • 21