Docker Community Forums

Share and learn in the Docker community.

Docker for Windows very slow (networking?, host directory as a volume?)

We’ve got a docker-compose setup that runs three containers:

  1. web server with WordPress
  2. database server with MariaDB
  3. Node.js application that the WordPress site talks to

All containers have mapped volumes like this:

    image: our/wp
      - "80:80"
     - ./blog_data:/var/www/html

    image: mysql:latest
      - "3306:3306"
      - ./db_data:/var/lib/mysql

    image: our/node-app
      - "3000:3000"
      - ./node_data:/usr/share/node-data-dir

The WordPress site uploads some of its files to the Node.js server via HTTP so there’s quite a bit of networking and file operations involved.

When I run this, it is extremely slow on Docker for Windows. For comparison, these are times per one upload operation as we tried them:

  • Linux: ~0.6s
  • Docker for Mac: ~3s
  • Docker for Windows: ~40s

I get that everything is slower on Windows, and my machine is not as powerful as colleague’s Mac, however, the difference seems too large.

Any ideas if this is “normal” and I should get 10x slower experience than on Docker for Mac (which is also virtualized and not as fast as Linux)? Is there something obviously wrong with my docker-compose.yml? I’m quite new to Docker.

1 Like

I had a similar issue with Docker + Windows + Wordpress. It turns out that it was the DNS that was too slow. One of the plugins that I had was making a remote call with cURL. And every request took more than 5 seconds to execute at which point the timeout kicks in and drops the execution. There were a couple of calls like this one during the request. So all in all it too my wordpress about 80 seconds to load.

I fixed the issue by removing all the nameserver’s in /etc/resolv.conf and replace them with (google’s). After that I ran “/etc/init.d/networking force-reload” and voila - quick and fast wordpress installation.

Maybe this is the case for you too.

1 Like

If you have time, could you build a (preferably) small reproducible test case that we can run too? Then we can figure out where the bottleneck is for you scenario, and start improving.

I’ll try to create a small repro during the holidays.

Hi, any progress?
I’m running WordPress under docker on Windows and it’s also slower than on Mac. :confused:

I also experience major slowness with docker-compose in docker for windows:
docker run myservice goes instantly (with all options from the docker-compose.yml file passed in as CLI paramters)
docker-compose run myservice takes almost a minute before even seeing the very first line in the output (starting myservice...)

changing the DNS to google’s in the docker setting panel doesn’t make any difference.
Any one more ideas what could make this so slow? How can I get more info (logs,…) to see what’s going on behind the scenes?

Since the previous update of docker for windows (17.03.1-ce-win5 (10743)) docker-compose suddenly became “lightning fast” in my case