
From Linux kernel VFS lock contention to hardware cache designs, uncovering Netflix's secrets to container runtime optimization.
This technical report explores how Netflix diagnosed system lockups during its container platform migration by diving deep into hardware-level details. It explains how NUMA and cache architectures of modern CPUs intersect with global locks to create performance bottlenecks, backed by empirical benchmarks.
If operating large-scale container environments, optimize image layer counts and verify potential runtime performance degradation caused by hardware characteristics when using idmap features for security.
Netflix encountered critical performance bottlenecks, including system stalls and 30-second health check timeouts, when launching many multi-layered containers simultaneously during its migration to a new container runtime (kubelet + containerd).
The team identified global lock contention in the Linux kernel VFS as the root cause and optimized containerd by changing per-layer mount operations to a single parent-directory-based operation, reducing complexity from O(n) to O(1).
Eliminating the global lock contention enabled stable container scaling across various CPU architectures, recovered CPU resources previously wasted on lock spinning, and normalized container startup latencies.
Trade-off
Adopting idmap features for per-container user ranges improved security but paradoxically triggered a surge in kernel mount operations, requiring a careful balance between performance and security during the initial phase.
A kernel feature that allows mapping UID/GID at the kernel level without changing file ownership, enabling safe file sharing across different user namespaces.
A memory design for multi-processor systems where each CPU has its own local memory but accesses remote memory with higher latency via an interconnect.
A synchronization mechanism in the Linux Virtual Filesystem used for global operations like modifying the mount table.




