Reply to post: Difference between this and virtualization

Docker: Sorry, you're just going to have to learn about it. Today we begin

Henry Wertz 1 Gold badge

Difference between this and virtualization

In a virtual environment, you either have Type I (bare metal) hypervisor or Type II (runs on top of an OS). VirtualBox for instance is Type II. Either way, you end up having a speed hit for any kernel code, although with modern tech like VT-X it's much lower.

First assume zero overhead. Your application generates requests. The requests are processed by the virtual machine kernel and passed to the virtual machine drivers. The drivers get the data to the hypervisor, the hypervisor passes along requests to the kernel and the real kernel's drivers finish the requests. There could also be dual caching as the VM kernel and real kernel both cache data.

In a container, your app generates requests; there's a little overhead while some layer vets the requests to ensure one doesn't break out of the jail; they're passed to the kernel and the driver finishes the requests. Much fewer steps.

In reality, virtio network and disk drivers can cut the virtual machine driver overhead down quite a bit; without it the virtual machine drivers and hypervisor are faffing about with various registers and whatever emulating a real network card, SATA controller, IDE controller, or SCSI controller. You also usually have to statically allocate RAM to VMs, whereas with containers you can set RAM usage limits but you otherwise just have a pool of available RAM.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon