-
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
Rootless --cpus results in Permission Denied #7959
Comments
@giuseppe PTAL I have verified this on my system as well. |
the cpu controller is not enabled by default for unprivileged users. To verify it, try running Try creating a file
and restart your user session |
after creating the delegate.conf file
success:
What are the implications of adding this config file? I'm guessing there's a reason why it's not setup by default. |
the reason for not enabling it by default is that the cpu controller used to be expensive, so systemd avoided to expose it to unprivileged users. AFAIK, that is not true anymore in newer kernels, so it should be fine to allow it |
Made a quick search and found this https://wiki.archlinux.org/index.php/cgroups#User_Delegation Not sure how it differs from the delegate.conf file, but I couldn't find info on that one after a (very quick) search. I can make a PR to the Troubleshooting Guide with some of this info, if you'd like? |
@giuseppe Could you open an issue/bugzilla with systemd to enable this by default in fedora 33/34? |
@keszybz is there any reason why it is not done yet? |
I don't think there's any particular reason, except for history as mentioned above. Do we have something from the kernel side that we could link to to justify that this is not expensive anymore? |
from a quick look, I cannot find anything in the git history |
FWIW, I can't reproduce this on the Fedora 33 beta. |
Unfortunately, it is still expensive with increasing nesting levels. Didn't really improve much. I don't know whether that justifies user-disturbing behavior differences tho. For context switch sensitive workloads, we see the overhead being easily above a percent of total cpu time per level. Whether that's prohibitive or not depends on the specific use case. |
Thanks @htejun. In case of rootless podmans, we have fairly deep nesting levels, e.g. But we could enable Delegate=cpu (as per #7959 (comment)). This will enable the cpu controller for |
It seems to me that we should document in the man page and perhaps make the error more helpful, to point them at turning on this nob. Only an extremely small number of users will ever run rootless containers with this type of setting, so the majority of users in the world should not pay the penalty. |
Where do you think documentation like that should live? This effects several CPU-related flags, so I would maybe add a quick note under |
Yes this should definitely be in the podman-run/podman-start man pages and should also be covered in troubleshoot.md. I think adding a comment about limitations on each one of the options pointing at the explanation in a new troubleshooting section would work well in the man pages. |
Done in #8134.
Sorry, I'm not sure I understand. Did you mean add an item to rootless.md? If so, my PR doesn't have that yet. We can discuss over there. 👉 |
A friendly reminder that this issue had no activity for 30 days. |
Man page and troubleshooting updated. Closing. Reopen if I am mistaken. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Executing a simple
podman run -it --rm -p 9000:9000 --memory 1G --cpus 1 localhost/bench-camel:latest
results inExecuting under sudo works correctly.
This issue seemed related containers/crun#489 but if I remove the
--cpus
flag the memory limit is applied correctly, so it's something specific to cpus.Steps to reproduce the issue:
--cpus
Describe the results you received:
Permissions denied error
Describe the results you expected:
Successfully limit cpus
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
No, and yes.
Additional environment details (AWS, VirtualBox, physical, etc.):
na
The text was updated successfully, but these errors were encountered: