-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker-compose run significantly slower than docker run #1062
Comments
I was blaming docker lately for being so slow for running phpunit, but tested it without docker-compose and was blazing fast, docker-compose is not usable for running tests, it takes more time for the container to actually run than the time needed for the tests. This needs to be fixed. |
@hugochinchilla Are you running on Mac OS X too? I've noticed that this problem is not present on Ubuntu. |
No, I'm running ubuntu. |
I have the same problem running cucumber and rspec test on my rails app container with docker-compose on Ubuntu 14.04 |
+1 on Mac OS X |
👍 The commands are really slow for me too using rspec. |
+1. About 10x slower for me. DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS" |
+1 Same problem here. Docker version 1.5.0, build a8a31ef |
+1 the same problem here |
Most of the slowness I've seen with compose will be fixed by #1066. If you have a large number of containers or images, it can take a while for compose to perform operations. However, I don't think that matches the problem in the original post. There seems to be some delay before it even runs the first docker api call. I'm not sure what that might be. I notice from the log that the hostname is For anyone +1'ing this issue, could you include more details about how it is slow? If you run with If anyone is familiar with python and able to provide a cprofile output with the results of a slow run, that would be extremely useful for debugging this issue. |
@dnephin hostname |
@Maxim-Filimonov perhaps you are able to ssh into the virtual machine and try to reproduce when running compose inside the VM, using a socket connection. That would narrow down the cause. Also, are you able to add the output of |
In my case I am not running docker inside a virtual machine. This is the command I use to launch the tests and the url with the output
|
Docker info (from inside virtual machine)
I have tried to run it inside virtual machine and it seems to be significantly faster then running from mac os x. Logs |
Not sure if this is the correct issue to post this but I've noticed considerable lag when building images. Server:
Client:
|
👍 Same issue, running verbose shows a huge hang at this point:
However when I run another container I get near instantaneous loading. Neither container (the slow one or the fast one) have links to any other containers. |
Actually scratch my above comment. Turns out my issue was due to using shared volumes. The container ran a gulp task runner, which involved a lot of reads on init to load plugins. The speed impact was due to the deeply nested nature of npm. Container speed improved massively when using NFS (as expected). |
Cannot replicate this issue with docker-compose 1.2.0 anymore. I presume it's fixed 👍 |
In my case I was always using docker-compose 1.2.0. |
same issue on mac. |
I'm still having the same issue on osx. I'm currently using the docker beta. docker-compose version 1.7.0 Tried the DNS workaround to no avail. [Edit 1] |
Got the same issue like @thejpanganiban |
@thejpanganiban @smith64fx can you report that issue on the Beta for Mac feedback forum; https://forums.docker.com/c/docker-for-mac ? |
I have docker-compose 1.7 on Mac OSX. I figured out that it comes (in my case) from my home network, but I cannot find why:
So it clearly comes from my home network, as I cannot reproduce it from work network. But what is happening there… The previous version of the beta docker for Mac OS also had problems with my network (could not pull any images), but since the last update of the beta, no issue anymore. I don't know if this is related or not, just giving everything I observed. |
@Erwyn is that on Docker Toolbox or Docker for Mac beta? |
This is from docker beta, but I haven't tried docker-compose with the docker toolbox, doing it right now |
@Erwyn thanks, if you can post the version of your Docker for Mac beta (from the "about" pane), that'd be useful |
Back, sorry for the time, it had to build/pull whatever some stuff. So @thaJeztah I confirm it is not reproduced with the docker toolbox, so basically it only occurs with docker for mac beta. My docker for mac beta version is Version 1.11.1-beta10 (build: 6662) And as I said before I also had a (my) network related issue but with the docker client. This issue also occured with the docker for mac beta and has been solved since one of the last updates. |
@Erwyn thanks! Passing it on to the Docker for Mac team now |
Thanks! |
@Erwyn just discussed some things with the team; first of all, can you open a new issue? It seems unrelated to the main issue discussed here, so better to keep it separate. Would you also be able to share your docker-compose file (if possible)? |
@thaJeztah Yes, sure!. The issue is #3419 |
Hi guys, I'm having similar issues of docker-compose 1.7.1 build 0a9ab35 |
I ran PS: I used opendns instead of google dns |
I am also running into a 2X performance hit when comparing |
I solveld this question staying my Dockerfile in sub-folder. php:
db: to php:
db: |
Same issue here with latest docker and latest docker-compose. Starting a rails console takes 12s when docker-compose up is used and about twice the time when docker-compose run is used. Really strange. How can I help to debug this? Hint: If I add privileged: true to the docker-compose.yml, up and run are equally fast! |
Same issue on my Raspberry Pi 3 using Raspbian. Even on simple commands like showing the version, where not much work should be done, I got very slow responsiness:
I installed docker-compose using pip as recommended in the official documentation. The latest Raspbian image at the time of writing is used:
|
+1 the same problem on Raspberry as @DMW007 |
Any suggestions in 2019 regarding how to run the tests without the very slow setup of docker-compose? |
I've noticed that
docker-compose run
seems to be significantly slower than plaindocker run
. Based on verbose logs it looks like it's slow due todocker resize
command.See example:
See logs https://gist.github.com/Maxim-Filimonov/7c90d303d102a0074c32
Additionally i'm not sure is that a problem with my specific terminal but i've noticed that
docker-compose run
does not start terminal prompt until I type something into it. In the gif you can see me typing pwd otherwise it just sits there without prompt forever.The text was updated successfully, but these errors were encountered: