How are container pid limits chosen for --pids-limit 0? #15596
Replies: 4 comments 12 replies
-
@giuseppe PTAL |
Beta Was this translation helpful? Give feedback.
-
if you run rootless, the cgroups are not configured for the container, so it will inherit the cgroup from Podman. |
Beta Was this translation helpful? Give feedback.
-
Hey all :) (disclaimer: I work with @jjenne-cisco and share the interest in this behaviour) Some of my thoughts around the above (and referring to https://docs.podman.io/en/latest/markdown/options/pids-limit.html):
My vote/interpretation would be:
As things stand, the best we can do is pass Any thoughts welcome :) |
Beta Was this translation helpful? Give feedback.
-
On Fedora 36 with cgroups v2, I see:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I expect that the container's
pids.max
should be set to 'max', but this is only true for Cgroups v2. No for Cgroups v1.Here are some datapoints on different VMs with cgroups v1 (ubuntu 20.04, podman 3.4.2) and cgroups v2 (ubuntu 22.04, podman 3.4.4):
(Runtime comparisons for extra data points)
Firstly, I'm not exactly sure where the "unlimited" numbers are taken from as on my VMs
/sys/fs/cgroup/{machine,system,user}.slice/pids.max
are set to 'max'. Nowhere in the cgroup v1 hierarchy should podman be inheriting the above numbers.I know that the default pid limit, when unlimited is not set on the CLI, is 2048 as set here and I can see that the
pids.max
file is being written with the limit here. But I can't work out the root of where the "unlimited" values are taken from and whypodman run --pids-limit 0 ubuntu cat /sys/fs/cgroup/pids/pids.max
is not 'max' like docker's default.Does anyone know any more about how or where the
resources.Pids.Limit
gets set in the case of--pids-limit 0
?EDIT: There is an e2e test with the line "pids-limit not supported on cgroup V1" - I'm assuming this is an incorrect skip reason as
--pids-limit
seems in every way supported on cgroups v1.Beta Was this translation helpful? Give feedback.
All reactions