You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.
prepare-app recursively bind-mounts /sys from stage1 to the stage2 (apps' rootfs). "Recursive" means it includes all the cgroup mounts because they are in /sys/fs/cgroup. Moreover, rkt bind mounts some cgroup knob files in the cgroup filesystem for enabling the memory and cpu isolator.
The number of cgroup bind mounts in stage1 is linear with the number of apps: O(n)
The number of cgroup bind mounts in stage2 is quadratic with the number of apps: O(n^2)
With one app, I have 17 bind mounts related to cgroups. With 100 apps, 17 * 100 * 100 = 170.000 bind mounts.
For each change in the mount table, systemd is notified via inotify on /proc/self/mountinfo and it checks the configuration of that mount in /etc/systemd/system, /run/systemd/system, /usr/local/lib/systemd/system and /usr/lib64/systemd/system.
systemd does about 30 syscalls per new mount notified via /proc/self/mountinfo. That would be 5.100.000 syscalls for mounting cgroups in a 100-app pod.
The text was updated successfully, but these errors were encountered:
Issue found via #2324: starting a pod with 100 apps is really slow. The problem goes away when testing with this patch:
prepare-app recursively bind-mounts /sys from stage1 to the stage2 (apps' rootfs). "Recursive" means it includes all the cgroup mounts because they are in /sys/fs/cgroup. Moreover, rkt bind mounts some cgroup knob files in the cgroup filesystem for enabling the memory and cpu isolator.
The number of cgroup bind mounts in stage1 is linear with the number of apps: O(n)
The number of cgroup bind mounts in stage2 is quadratic with the number of apps: O(n^2)
With one app, I have 17 bind mounts related to cgroups. With 100 apps, 17 * 100 * 100 = 170.000 bind mounts.
For each change in the mount table, systemd is notified via inotify on /proc/self/mountinfo and it checks the configuration of that mount in /etc/systemd/system, /run/systemd/system, /usr/local/lib/systemd/system and /usr/lib64/systemd/system.
systemd does about 30 syscalls per new mount notified via /proc/self/mountinfo. That would be 5.100.000 syscalls for mounting cgroups in a 100-app pod.
The text was updated successfully, but these errors were encountered: