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.
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 8.8.8.8 (google’s). After that I ran “/etc/init.d/networking force-reload” and voila - quick and fast wordpress installation.
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 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 8.8.8.8 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?