0

Looking at this question and its answers, it's clear that a few points make container services fairly different from traditional VMs:

  • They can save on performance and space by sharing the host's operating system

  • They further save space using the AuFS filesystem, which allows them to share the hard drive with the host

All of this allows them to boot in a fraction of the time it takes for a full VM.

I may have some misconceptions about how KVMs work and about the hypervisor model, but aren't containers much like KVMs? In what do they differ, and what are the performance gains/losses for either of them?

Jules
  • 14,200
  • 13
  • 56
  • 101
  • >>>All of this allows them to boot in a fraction of the time it takes for a full VM. You hould have a look at unikernels, see for example https://www.linux.com/news/enterprise/cloud-computing/819993-7-unikernel-projects-to-take-on-docker-in-2015 – user2915097 Jul 09 '15 at 14:25

1 Answers1

1

I may have some misconceptions about how KVMs work and about the hypervisor model, but aren't containers much like KVMs? In what do they differ, and what are the performance gains/losses for either of them?

A virtual machine is just that -- "virtual" hardware that can boot pretty much any compatible operating system. For example, you can run Windows in a VM on your Linux host. A VM provides a variety of emulated hardware, including the CPU, network cards, storage interfaces, and so forth.

In contrast, a container is nothing more than a collection of processes on your host. Processes running inside the container are no different from processes running outside the container -- from the host you can see them with ps, manage them using tools like kill, etc. Because of this, processes running in containers are using your host kernel -- you can't, say, run a Windows binary inside a container on your Linux host.

Because they're not performing any sort of hardware virtualization, containers are substantially lighter weight than virtual machines. As long as you are able to work with their limitations (ie., the fact that they are limited to the host operating system kernel), they will yield better utilization of hardware than running the same services inside a virtual machine.

larsks
  • 277,717
  • 41
  • 399
  • 399
  • I was under the impression that KVMs have much more limited hardware virtualization than a "full" VM - and that containers use a form of sandboxing similar to that. Is there any truth to that? – Jules Jul 09 '15 at 13:19
  • Maybe we have a conflict of terms? To mean, "KVM" is the virtualization implemented by the Linux kernel ([this one](http://www.linux-kvm.org/page/Main_Page)) -- and this is what I assumed you were asking about -- and this is full hardware virtualization. If you are actually referring to something else, this answer may in fact not be relevant. – larsks Jul 09 '15 at 13:21
  • That's the one... I think I was misled by the person who initially explained KVMs to me. – Jules Jul 09 '15 at 13:29