Hardware virtualization provides the ability to isolate multiple applications from each other and utilize hardware in a more efficient way. At the same time each VM requires its own full OS, TCP and file system stacks, which uses significant processing power and memory of the host machine.
Each VM has a fixed amount of RAM and only some hypervisors can resize VMs while running with a help of memory ballooning. That is why it is crucial to reserve resources in each VM for the further application scaling.
In such a case these resources are not fully utilized and cannot be shared with other applications due to the lack of proper instances isolation inside a VM.
What about containers? They win the performance and resource utilization battle with a possibility to share the OS kernel, TCP stack, file system and other system resources of the host machine while using less memory and CPU overhead.
There are two types of containers:
- application container, that usually runs as little as a single process
- and system container, that behaves like a full OS and can run full-featured init systems like systemd, SysVinit, openrc that allow to spawn other processes like openssh, crond, syslogd together inside a single container.
All in all, containers do not waste RAM on redundant management processes, generally consuming less RAM than VM. However, in case you need to migrate legacy Java EE apps without a redesign necessity, - it is possible only with system containers migration.
Unlike VMs the resource limits in containers can be easily changed on the running instances without restart. And the resources that are not consumed within the limit boundaries are automatically shared with other containers running on the same hardware node.
The resources that are not utilized at the hardware can be easily used by the existing containers while scaling or for new applications workloads. Considering advanced containers isolation, different types of applications can be run on the same hardware node not influencing each other. This allows increasing resource utilization of the existing infrastructure on 3x-10x times in average.
Would like to try free a container based cloud platform? Register for a trial and create, package, test your applications in an agile way to accelerate application development processes and improve the scalability of applications.