Answer the question
In order to leave comments, you need to log in
Is it normal that when working through Docker, my app noticeably slows down?
Good time of the day!
Started learning docker. After a day of agony, I ran the project on a full stack using docker. But now I see an increase in response time from the server. App worked instantly on the local machine on the standard nginx + php-fpm 7 + mysql stack. After setting up a similar stack on docker, everything works noticeably slower. How can this be fixed?
version: '2'
services:
nginx:
image: jboesl/docker-nginx-headers-more
ports:
- "80:80"
- "443:443"
volumes:
- ./:/site
- ./docker/nginx:/etc/nginx/conf.d
depends_on:
- fpm
links:
- fpm
fpm:
build: ./docker/php
expose:
- "9000"
volumes:
- ./:/site
links:
- mysql
mysql:
image: mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_DATABASE: "portal"
MYSQL_USER: "app"
MYSQL_PASSWORD: "app"
volumes:
- mysqldata:/var/lib/mysql
volumes:
mysqldata:
driver: "local"
Answer the question
In order to leave comments, you need to log in
a host system what?
it should be understood that everywhere except the penguin, docker is virtualization and, accordingly, an additional overhead and / or unexpected brakes (for example, in macos, a "virtual" docker works faster than a "native" one).
Docker is a Linux-only containerization tool (although FreeBSD can be cocked inside there as well).
Thus, initially we need a WORKING Linux kernel.
If you are running Docker on Linux, this is not a problem. Launching a container is almost instantaneous.
If you are running Docker on Windows or MacOSX, then you must first download Linux itself in order to load containers there.
In real combat systems - Docker is run ONLY on Linux servers. But for debugging, you can do it anywhere. Just accept that if this is not under Linux, then the launch will be long.
To summarize:
Under Linux, running an application in Docker is just a container, that is, just an isolation of operating system API calls.
Under non-Linux, running an application in Docker requires initially running Linux itself in a virtual machine.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question