In this work we compare virtualization and container technologies with the goal of recognizing fields where one technology has advantages over the other. In its beginnings the x86 architecture was not designed with virtualization in mind. The existence of ``virtualization sensitive'' instructions does not allow the use of ``trap-and-emulate'' solutions, as they are used in other architectures. As a consequence, other solutions were developed, such as full virtualization with binary translation and paravirtualization, with hardware support for virtualization added to processors after 2005. All three solutions add overhead when running virtual machines. Container technology, also called operating-system-level virtualization or lightweight virtualization, avoids this overhead because containers use operating system features for application isolation. Main shortcomings of container technology are a bigger security risk because of the shared kernel and an inability to run other operating systems inside a container.
Containers should present a smaller load for the host, consequently that means more resources available for containers, which means better performance. We wanted to research how large this difference in performance between a container and a virtual machine is, so we executed tests covering different fields. Firstly, we tested the physical system and then we tested different virtualization and containerization solutions: KVM, Xen, LXC and Docker. Our chosen tests were: Intel Optimized LINPACK, STREAM, RandomAccess, netperf, fio, bonnie++ and UnixBench.
The results show a slight advantage in performance for containers in all fields. This advantage, however, is not large enough for us to conclude without reservation in which field a certain technology has an absolute advantage before the other. There were also differences in results using different solutions of the same technology, which show the effect of implementation of the solution on the performance.
|