-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default cpu-shares are 0, but documentation says it is 1024 #4822
Comments
are you running as rootless? |
🙈 yes ... which totally explains the difference. So we should make the default value conditional and update the docs? |
In my example I was running as root, as it is not supported as rootless (to my knowledge).
(this is CGroupsV2 of Fedora 31) |
1024 is the default also when running as rootless. The difference is that it cannot be modified. I think the issue here can be that 0 means "unspecified", given that the minimum value for cpu shares on cgroup v1 is 2. I think we should just convert 0 to 1024. |
@giuseppe the default is set to 0 (see https://github.com/containers/libpod/blob/master/cmd/podman/common.go#L192). |
which is fine. When it is set to 0 then its value is not set in the OCI spec file as libpod treats it as unspecified by the user: https://github.com/containers/libpod/blob/master/pkg/spec/spec.go#L187-L189 So I think the issue is only in In the inspect output, should we convert 0 to 1024 which is the default "most of the time" value used for the cgroup? We can't really assume it though as we could re-use an existing cgroup or configure systemd to use a different value. I don't see how we can make the inspect output better and make it clear that 0 means "it uses whatever value the cgroup is configured with". The same problem exists with other cgroup settings as well. |
I would think that we set it to 1024 by default in the output, given that we should only be overriding it if the resource limits struct is actually present and populated in the spec? |
Minimum value is 2. Default value is 1024. We still test that if we don't set it up, it is 0, but for that see containers/podman#4822 Fixes cockpit-project#287
Minimum value is 2. Default value is 1024. We still test that if we don't set it up, it is 0, but for that see containers/podman#4822 Fixes cockpit-project#287
Minimum value is 2. Default value is 1024. We still test that if we don't set it up, it is 0, but for that see containers/podman#4822 Fixes: cockpit-project#287 Closes: cockpit-project#289
Minimum value is 2. The default value is 1024 (or value set up in cgroups). Let's not assume any value. Also podman reports `0` as default. We still test that if we don't set it up, it is 0, but for that see containers/podman#4822 Fixes: #287 Closes: #289
This is purely a display change - we weren't initializing the default value to display for the CPUShares field, which defaults to 1024. Fixes containers#4822 Signed-off-by: Matthew Heon <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
From doc:
But when I run container without specifying
--cpu-shares
it has cpu-shares set to 0.Steps to reproduce the issue:
Describe the results you expected:
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):The text was updated successfully, but these errors were encountered: