KVM and Docker LXC Benchmarking with OpenStack
bodenr.blogspot.com
bodenr.blogspot.com
If you wanted something as "esoteric" as having normal networking in your container, you had to understand how Docker abstracted LXC in the first place, then find out how to do things the LXC way and then push your changes through, with some extra duct-tape with pipeworks.
And if that's the start, before I've even done anything, I can't imagine things getting better. So Docker? No thanks.
Then I'll just go ahead and use LXC directly. It involved a bit more research, but nothing you can't do in a few hours. And when you do, you can get to benefit from BTRFS volumes and having snapshot management tied directly to your containers.
Maybe I'm missing something, but after fooling around with this for a few days, I can't see why anyone would choose the leaky abstraction that is Docker when you can just go with the real deal.
I guess my project wasn't suited for docker. All i needed was an image to run a process in a custom environment. I didn't need the Dockerfile and versioning stuff. Which, in my opinion, is the reason to use docker.
So instead of saying "Docker, no thanks", you probably did not find a suitable project. Which is good! I see a lot of people using docker, just because it's awesome and everybody on HN is talking about it.
And then I see no need to meddle in meta-frameworks to cover for potential use-cases I don't have, no matter how well they are engineered or tested.
Docker obviously has some work to do, but, I think you do it a disservice by ignoring the rest of the cool stuff the ecosystem brings with it.
One thing I'm very interested by is Docker's idea of single-process containers; but whether this can be done with KVM isolation instead of (weaker but cheaper) LXC isolation. One thing I was surprised by from this presentation is that the memory cost of a KVM vs LXC instance was only 185MB vs 45MB. So KVM's stronger isolation might not be as expensive after all...
Also keep in mind there are currently 23 pages of mysql images on docker index right now https://index.docker.io/search?q=mysql. Choosing an image which has "proper" bootstrapping is sometimes a trial and error process. This process is a bit more cut and dry with hypervisor / VM based images where you get a standard set of init processes out of the box.
RE KVM -- I agree KVM is impressive and the low memory overhead is likely a result of KSM (memory de-duplication) which is enabled out of the box on Ubuntu 12.04 with KVM 1.0.
I appreciate the transparency in admitting that you re-ran the test, and appreciate anyone that tries to provide data for OpenStack. But you shouldn't claim that you're just publishing numbers for people to interpret as they will, when interpretation entered into the production of those results. It's just not valid experimental practice.
However let me reiterate the intent of the existing work... The benchmark's purpose is to educate the community on the potential benefits of a LXC based technology (primarily from a Cloudy perspective) by providing a set of data points with full disclosure as to the means / methods used to perform tests and collect results. I expect any organization, group or individual considering actions as a result will perform their own validation to assert the technology choice is beneficial for their consumption prior to adoption. I believe this criteria is met in the current publication and therefore the results will stand on their own.
As to test configuration variations such as those stated above (disable KSM, boot by clone, etc.) -- I believe additional data sets collected via variations or other benchmarks are key to obtaining a well rounded understanding of the factors / benefits involved in this space and I encourage the community to create / publish such results. As an example I would like to gauge the impact of the various KVM guest cache modes and docker LXC storage providers which I believe are fair game to test and add as a variation to the existing benchmark.
Should you wish to iterate other configurations / requirements you believe are worth exploring I can make note of them for the next round of tests (time permitting). In addition I'm more than happy to document the instructions to setup and perform these tests so that others can run it themselves. I gladly welcome additional tests and data points from the broader community at large.
See https://phusion.github.io/baseimage-docker/ as an example of a full-OS docker base image designed to be lightweight.
These days, you can run the full OS inside docker[1][2], but you'll likely be running more than you need to.
[1] https://github.com/dotcloud/docker/issues/1024 [2] https://github.com/dotcloud/docker/issues/2276
It's a powerful idea which to date has been tied to LXC containers, though I think that's a false association: it's just as interesting with KVM or Xen containers.
That being said, running init inside of a container is definitely a supported use case.
The beauty (to me!) of Docker is that it still applies whether you're talking about any linux-based infrastructure. There are just trade-offs to be made in certain cases (like performance/density for very strict isolation)
If you have your hosts running CentOS and want to deploy on Windows, for example, or want to migrate some legacy server to the "cloud" this might not work well for you.
There are some folks having a lot of success taking apps running on old versions of centos and running them on later versions, as an example.
To elaborate - Some distros / companies are planning it to be part of their upgrade strategy - i.e, containerize the application, move to <your distro of choice cough rhel 7/atomic cough> while having the userland of the previous release intact.
Using Windows? lets use KVM.... Using budget compute and linux, lets use LXC.
Now deployment, isolation, repeatable test and dev environments is a bit of a different beast. So LXC works great there.
The point was to avoid the conclusion that KVM is useless now in all cases, throw it away tomorrow and start using LXC.
I certainly wouldn't. Those are definitely what I call "general" virtualization cases.
And as awesome as containers are, they wont be able to cover for these cases. It's definitely worth mentioning for those who are not familiar with the matters.
In speaking to him he's very well aware about libcontainer.
I'm annoyed that the new LXC execution driver appears to have broken something in the LXC networking; previously I was able to run a Docker container using LXC networking, give it its own MAC address and have it assigned an IP address by my router and be visible to all other devices on my network (use case: a container to run Plex Media Server).
Given OpenVZ is an LXC technology, comparing docker to OpenVZ would have been more of a comparison between different LXC providers. I agree this would be interesting, however not in line with the intent of the tests.. BTW -- I'm aware that OpenVZ is probably the most mature LXC solution out there.
As for docker vs Xen paravirt, that would be interesting as well and the information I presented clearly stated additional testing is warranted. I would encourage others to try such configurations and present results.
I encourage anybody that has problems with your experiment to go out and retest the results and share their work!