News for hackers. Stuff that matters.
Re:How does Docker affect energy consumption? by acdha on Friday May 05, 2017 @09:27AM (#14273235)
> Of course you are condensing. Those small VMs would have been running a full OS runtime each.

That's something but probably not as much as you think since hypervisors can share identical pages (e.g. the Linux kernel) across guests and the base footprint for a server Linux install is not that high as a percentage of the private data most applications use. Unless you're running a ton of unnecessary services on those guests or have an application which uses almost no RAM you're talking about a fairly modest percentage savings even before you factor in all of the things you might be running for container management and other overhead on that side.

The other thing to remember is that this works both ways: containers are great for being able to upgrade one component independently but that means that e.g. you might have a dozen different versions of a common shared library because not all of your containers are using the same base image & version and with Docker your storage driver might actually force shared libraries to be duplicated across all processes anyway.

Re:How does Docker affect energy consumption? by sdeziel on Friday May 05, 2017 @12:50PM (#14274842)
> since hypervisors can share identical pages (e.g. the Linux kernel)

With ASLR, I'm now sure the gains are that substantial.

Re:How does Docker affect energy consumption? by derefr on Friday May 05, 2017 @06:37PM (#14277318)
The parent doesn't mean that the hypervisor will merge identical MMU->physical page mappings (like a Copy-on-Write process fork would); they mean that VM pages' underlying host virtual pages literally get periodically hashed for their current content by a background process on the dom0 and merged when they are found to have identical hashes. The underlying virtual page is then made copy-on-write.

Or, to put that another way: the host memory for most modern hypervisors consists of a heap of "new" pages, and then a generational garbage collector that moves said pages, if still alive, into a content-addressible "old" store.

As such, if two VMs each have a process that

1. calls malloc() 1000 times to get 1000 1-page buffers randomly spaced through their memory, the mappings different for each VM; and then

2. uses a fixed PRNG seed to generate random data [but the same random data] to fill those pages;

then those two processes' pages will still get collapsed together for a 50% savings.