-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
when docker use --cpu-quota and systemd daemon-reload, old container's cpu.cfs_quota_us become -1 #30121
Comments
It looks like you're running the Red Hat fork of Docker, which containers various modifications to run "systemd" inside a container (e.g. the Be aware though, that running I'm closing this issue because of the above, but happy to answer questions after that |
@thaJeztah The daemon process in my container is just a java program. But I also face the same problem as @muahao say. |
Looks like I may have closed prematurely, and this may be related to systemd cgroups; Using the default options ( docker run --cpu-quota=50000 --cpu-period=100000 -d centos /sbin/init
d6833321af721240058e8b7668a6d67fd4c7857d672a9c15e9c976e6dd91dc3e
systemctl daemon-reload
cat /sys/fs/cgroup/cpu/docker/d6833321af721240058e8b7668a6d67fd4c7857d672a9c15e9c976e6dd91dc3e/cpu.cfs_quota_us
50000
docker run --cpu-quota=50000 --cpu-period=100000 -d centos /sbin/init
9c533c2fdf11641ba89d36d650012e19fbafaa67fee58877557f1ae518ba5f10
cat /sys/fs/cgroup/cpu/docker/d6833321af721240058e8b7668a6d67fd4c7857d672a9c15e9c976e6dd91dc3e/cpu.cfs_quota_us
50000
cat /sys/fs/cgroup/cpu/docker/9c533c2fdf11641ba89d36d650012e19fbafaa67fee58877557f1ae518ba5f10/cpu.cfs_quota_us
50000 Switching to
I think those cgroups are handled by RunC though @mlaventure ? |
@thaJeztah I have found the cause of the problem, and I have a solution to solve it. Later I will post a pull request of docker and make a link to this issue. |
Thanks @xuxinkun ! |
cpu.cfs_quota_us and cpu.cfs_period_us should be controlled by systemd. |
Docker 1.10.3 is EOL and no longer maintained, so you'll have to open the change against "master". I think that part of the code is no longer in docker/docker though, and now in the |
oh, actually, that link is for |
Yes, I also make a PR for runc opencontainers/runc#1344 |
Thanks! |
Let me reopen, because opencontainers/runc#1344 has not been vendored yet in this repository |
@thaJeztah Should I update the runc vendor or just wait some one to update it? |
@xuxinkun due to RunC not being "stable" yet (no 1.0 release), docker currently uses a fork, so we need that fork to be updated, and the patch cherry-picked into the 17.03.x branch; https://github.com/docker/runc/tree/17.03.x. Once that's done, the version can be bumped by updating the commit here; https://github.com/docker/docker/blob/9bf36cb4431b9f06f290658668415d9150618739/hack/dockerfile/binaries-commits#L6 ping @mlaventure @crosbymichael are you able to assist with this? |
hello ,I got a problem , But I am not sure it is systemd's problem or docker's problem, It is easy to reproduce.
When I use
docker run --cpu-quota=50000 --cpu-period=100000 -d docker.io/centos /sbin/init
to start the first container A, and then executesystemctl daemon-reload
; then , I start the second docker container , the first docker container's valuecpu.cfs_quota_us
will become-1
Is systemd's logical or is docker's bug?
docker version
How to reproduce
1. docker use --cpu-quota start a container
2. systemctl daemon-reload
we can see cpu.cfs_quota_us
3. start another new container
4. old docker container's cpu.cfs_quota_us value become -1
5. My Analysis
BUt , If I do
systemctl set-property xxx CPUQuota=10%
, andsystemctl daemon-reload
, I find , this value will not be changed , So I think if it is systemd's logic and it will likely to be a docker's bug ?The text was updated successfully, but these errors were encountered: