-
Notifications
You must be signed in to change notification settings - Fork 122
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
Severe Docker 1.12.1 performance regression with DB2 images (~10x slower) #668
Comments
ping @dsheets |
I am going to test if this is an issue just on Linux, as there is not much visible Docker for Mac specific stuff here (eg no volumes or network) |
@justincormack I didn't try Linux, but I did try with docker 1.12.1 on docker-machine (virtualbox driver). Works fine there for this particular test, virtually the same time as docker 1.12.0 for mac |
@malduarte yes it may be Docker for Mac specific, but it is not obvious why, it could be for example related to the Linux runtime or something... |
Sounds like @djs55 has an idea of what may have caused this |
So it appears this may be because in previous versions it was not fully flushing blocks on |
I have similar issue with PostgreSQL. It's approximately 10x slower after Docker for Mac upgrade to 1.12.1 |
@justincormack : That makes sense. I understand current sync behaviour should be the default (event with the slow performance). Correctness should trump fast. That being said Is there some kind of configuration option to disable |
Thanks very much for the easy to follow repro instructions. I ran 2 experiments:
It seems the VM calls the virtio-blk implementation of flush in hyperkit approximately 25000 times. Each of these is implemented currently by an fsync(F_FULLFSYNC) to avoid writes being partially written or re-ordered over a power loss (as recommended by the Apple docs). Unfortunately each I agree that there are important use-cases where data persistence is less important than throughput, especially on developer setups or CI builds where containers are ephemeral. I'll investigate the possibility of a configuration option. |
ooops, closed accidentally. Sorry folks |
+1 |
I've added a configuration option to the master branch and it should be released in the next beta (27) later this week. It's not wired up to the UI yet. I'll post instructions explaining how to change the setting when the beta is ready. |
@kingbuzzman I'm am running UPDATE: Appears to be due to volume mapping. This takes a few seconds:
This takes 1 min 30s:
|
@c0bra how big is |
if you don't stop the postgresql container correctly, the next time you start the container postgresql will do a validation check on all your data. use docker run without |
@kingbuzzman 644MB. @jack0 I'm using docker compose. I tried using the NOTE: It doesn't seem to matter whether I use |
In case i missed it, do you guys host-mount the /var/lib/postfgres ( or whereever your postgres data folder is ) or do you use a named-volume / anon volume for it? what i see is this If you insist on doing that, use http://docker-sync.io (i am biased) and you get native speed back - but straight volume mounts will slow down enormously |
@EugenMayer I guess I'm doing the bad one then. I did try to get docker-sync working for a bit today; I can to finish that up and see if it improves. Thanks for the suggestion. |
@c0bra docker-sync will bring it back to what you get without volume mounts, simple as that ( its just native speed ) - we did quiet some benchmarking here: https://github.com/EugenMayer/docker-sync/wiki/4.-Performance |
@EugenMayer yep that did it. Blazing fast now! Thank you so much. If I ever come across the pond I'll buy you a beer :) |
Is this still actual? When i go to Later edit: apparently, my docker was setup to only allow 2 GB of memory for containers, which I hadn't noticed from the beginning. Setting it to 8 turned everything back to Linux normal (from Docker GUI -> Preferences -> Advanced). So... don't forget to allocate enough RAM for the containers to be able to run :) Oh, and btw, I didn't had to run the solutions presented here, it works from the box. |
if the container doesn't have mission critical data in it, but still require high throughput I/O, is it safe to set this sync option to |
I'm on ~/Library/Containers/com.docker.docker/Data $ ls com.docker.driver.amd64-linux/
Docker.qcow2 console-ring.0 console-ring.2 console-ring.4 lock mac.0 pid tty
console-ring console-ring.1 console-ring.3 hypervisor.pid log/ nic1.uuid syslog So maybe in recent versions the right path to create the cc @booi |
Not sure if I'm suffering from this problem - very new to docker. But I am composing a simple apache/php container with a mysql container volume mapped to a local directory for data storage. When I run my application through the containers I get intermittent connection problems to the MySQL container. Could this be down to the I/O speeds? |
@leepowellcouk no this is something else, see the purpose of scripts like https://github.com/vishnubob/wait-for-it - in short ( to not drag offroad here ): your app starts faster then your database, thus the db is "not yet there", so people use those scripts to "wait for the db" before starting the actual app app-container entrypoint |
@EugenMayer - Thanks, I'm not sure that's it as it happens across browser refreshes. I'll take a look elsewhere and see if I can work out whats going on. |
@leepowellcouk your problem is
Volume bind-mount in mac/windows is very slow: For persistence just use docker named volumes. Don't mount it to local folesystem. Such volumes are almost persistent (you can delete them by docker system prune). If you need local copy as well just periodically use "docker cp" :) Problem starts, when you want your codebase to be locally mounted (obvious usecase). Then if it's something like Symfony php app (lot of writes on cache generation) it will be sluggish. That's why tools like docker-sync exists until docker team will solve this more then one year old issue with bind mounting. But this is offtopic ;) |
@barat - Thank you, I don't want to derail this issue. I have tried to use docker named volumes and get the same problem. |
Tried @djs55 way and it works for me as well! Docker version 17.09.0-ce, build afdb6d4 Wonder if this setting can just be the default one for Mac. |
@vampolo thanks for the update. For reference the current
Systems using the older Since this is fixed in edge, I'll close this issue. If there are future problems feel free to open fresh issues! Thanks for your patience and for using Docker for Mac. |
That is great news to hear. As always, thanks to the Docker team for continuing to improve the product offering. Are there any additional steps that Docker for Mac users need to take, other than upgrading to the latest version, in order to get this new performance improvement, such as setting a configuration value? How can we verify that our setup is correct and that we are getting the new and improved version? Thanks in advance. |
My docker version:
There is not exist disk directory, and anything. |
@for0231 try |
I have the same question as @for0231 |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
Performance equal or better than 1.12.0
Actual behavior
Docker 1.12.1 is much slower on pretty much all DB2 activity. Not sure if it is DB2 only, but I'm only experiencing it on DB2. For example empty database creation takes ~24 seconds on 1.12.0 but on 1.12.1 it takes 10 times more, around ~253 seconds
docker stats seems to indicate lower cpu usage and lower I/O activity on 1.12.1
Information
Steps to reproduce the behavior
docker pull ibmcom/db2express-c
docker --version
should outputDocker version 1.12.0, build 8eab29e
time docker build -t test .
Consider running docker stats while it is runningdocker rmi <imageid>
docker --version
should outputDocker version 1.12.1, build 6f9534c
time docker build -t test .
. Consider running docker stats while it is runningThe text was updated successfully, but these errors were encountered: