I was curious about the impact Docker could have on performances. Googling around lead me to a study published by IBM: An Updated Performance Comparison of Virtual Machines and Linux Containers. Though it includes a Docker vs KVM comparison that was initially out of my concern, It’s been very interesting to read.
Docker induces no significant overhead on CPU nor memory usage, compared to a native execution (worse observation: -4%; 0% on all others)
Using Docker NAT is not cheap. It almost doubles the latency and has a measurable CPU overhead (adds 0.5 cpu-cycle per byte out of 2 for transmission and out of 2.25 for reception).
Using the host’s Net namespace restores performance to the native level; interesting only if your use-case doesn’t require network isolation.
Using Volume storage has no impact on pure block I/O performance (sequential throughput, random access throughput and latency).
Using AUFS (storing inside containers) is expensive: performance is 20% inferior compared to Volume (see fig. 10 MySQL transactions/seconds).
Redis and MySQL tests reveal Docker (without NAT nor AUFS) achieve almost identical performances than the native system.
On the overall, Docker equals of exceed KVM performance.
KVM’s default configuration hide the host hardware’s topology to the guess OS&Apps, hindering the auto-tuning of some advanced libraries (ie. Intel MKL)