Follow us
Breaking
Tech News

Container performance and architecture differences

Containers deliver equal or better performance than VMs in most CPU and memory stress tests according to IBM Research. This comparison examines the architectural differences between Docker and Podman, including Podman's daemonless design and security benefits.

Share

VMs like KVM run an unmodified guest OS on their own kernel. This isolation keeps the software code separate from the host. Containers like Docker or Podman use the host kernel. This approach minimizes the footprint. However, as more aspects of the OS go into a container, the container gets bigger and requires more resources. IBM Research findings show that containers deliver equal or better performance than VMs in almost all cases when stressing CPU, memory, storage, and networking resources. Cloud providers use VMs to isolate workloads and control resource usage, but hypervisor overhead acts as a tax on performance. KVM uses hardware acceleration and paravirtual I/O, such as virtio, to reduce this overhead. It also supports emulated I/O devices through QEMU. Spinning up a complete OS to run one application is inefficient because the OS takes considerable resources to run. A user running a perception pipeline on an NVIDIA Jetson AGX Orin observed a 47ms delay in Docker compared to 26ms on the host. VMs allow hardware pass-through for NICs and HDDs, but containers do not support HDD pass-through. You should use VMs if you need to run an application requiring a different OS or if you want to keep code isolated from the host. A Windows Server 2019 instance can be configured with 8 processors and 32GB of RAM to run nearly like bare metal through hardware pass-through. Containers are faster if the application can run on the host kernel and the virtualization footprint remains minimal.

Podman versus Docker command line workflows

Podman is a daemonless, rootless alternative to Docker. Docker relies on a long-lived daemon to perform operations on images and containers. Podman executes commands as short-lived processes. This design removes the single point of failure found in the Docker daemon. Podman allows users to manage pods, which group containers into a shared namespace, network, and security context. Podman’s CLI mirrors the Docker CLI, so users frequently create an alias to direct docker commands to podman. Podman uses Buildah to build OCI images. Podman lacks a direct replacement for docker-compose, though podman-compose exists in development. Podman has a generate command to export pods to Kubernetes-compatible YAML. Podman Desktop provides a GUI to manage containers, images, volumes, and pods on Windows, macOS, and Linux.

Feature Docker Podman
Architecture Daemon-based Daemonless
Privileges Often requires root Rootless by default
Pod Support No Yes
Image Building Docker build Buildah

Podman security results from its ability to run containers as regular users without administrative rights. This approach follows the principle of least privilege. Even if an attacker compromises a container, the damage remains contained because the process lacks root access to the host. Podman manages containers as independent Linux processes. Red Hat adopted Podman as the default container runtime for Red Hat Enterprise Linux. Podman Desktop lets developers pull, build, tag, push, and troubleshoot containers through logs.

Running Podman inside Incus containers

Running rootless Podman inside Incus containers on Ubuntu 24.04 triggers errors because Ubuntu 23.10 restricts unprivileged user namespaces. The error occurs because Ubuntu 23.10 restricts unprivileged user namespaces, which prevents unprivileged processes from creating user namespaces unless they possess the "userns," rule within their specific configured AppArmor profile. The system returns the error "Userns create restricted – failed to find unprivileged_userns profile". One option involves disabling the restriction with sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0, but this option is insecure. Another option involves setting lxc.apparmor.profile=unconfined in the container config, but this is also insecure. You can manually create an unprivileged_userns profile using sudo apparmor_parser on the host. You could also use your own AppArmor profile with raw.apparmor = profile. If you choose to run Docker inside an Incus container, you must set security.nesting true. Docker with VFS in a container can cause slowness and waste resources. You probably know that nesting requires specific configuration settings. Does the performance penalty of running containers inside containers justify the isolation? Podman is the best choice for users who prioritize security and Kubernetes integration.

Share

Technewsdaily

Senior tech writer covering AI, gadgets and cybersecurity. Breaking down the news that matters, every day.