mirror of
https://github.com/containerd/containerd.git
synced 2026-08-13 17:07:26 +00:00
Per layer idmap'ed bind mounts are costly to performance, as shown in [0]. Each one requires taking various kernel locks, and each one shows up in the host's mount table leading to some components like systemd processing all these temporary mounts unnecessarily. Let's instead go ahead and idmap the common directory of all the layers to achieve the same effect. Now instead of being a function of the number of layers, its a constant idmap per overlayfs! This can have a big impact. For example, imagine running 100 containers at once, each with 50 layers. That's going from doing 100 * 50 (5000) bind mounts, to just 100. In reality both the shim and containerd proper do this, so its actually double that! [0]: https://github.com/containerd/containerd/issues/12048#issuecomment-3050444019 Signed-off-by: Andrew Halaney <ahalaney@netflix.com>