Skip to content
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

当我对容器CPU资源做了限制后,CPU满载实验的--cpu-percent参数限制好像有问题。 #463

Open
Grrui opened this issue Jan 22, 2021 · 1 comment
Labels

Comments

@Grrui
Copy link

Grrui commented Jan 22, 2021

Issue Description

bug report

Describe what happened (or what feature you want)

当我对容器CPU资源做了限制后,此时CPU满载实验中--cpu-percent参数的限制好像是按整台机器的性能做的计算,不受CPU限制参数的影响。
例如:docker run --cpu-shares 1024 --cpu-quota 100000 --cpu-period=100000 tomcat 启动容器,
image

命令一:--cpu-percent 100
blade create docker cpu fullload --cpu-percent 100 --blade-tar-file /root/chaosblade-0.9.0-linux-amd64.tar.gz --container-id 31e0e5e4ac86
此时docker stats显示利用率100%
image

命令二:--cpu-percent 50
blade create docker cpu fullload --cpu-percent 50 --blade-tar-file /root/chaosblade-0.9.0-linux-amd64.tar.gz --container-id 31e0e5e4ac86
此时docker stats显示利用率还是100%
image

Describe what you expected to happen

--cpu-percent计算时,可以兼顾下容器上设置的资源限制。

How to reproduce it (as minimally and precisely as possible)

  1. 带CPU限制的启动容器:docker run --cpu-shares 1024 --cpu-quota 100000 --cpu-period=100000 tomcat
  2. 满载100% blade create docker cpu fullload --cpu-percent 100 --blade-tar-file /root/chaosblade-0.9.0-linux-amd64.tar.gz --container-id xxx
  3. 满载50% blade create docker cpu fullload --cpu-percent 50 --blade-tar-file /root/chaosblade-0.9.0-linux-amd64.tar.gz --container-id xxx

Tell us your environment

image

Anything else we need to know?

@CodeHcy
Copy link

CodeHcy commented Sep 9, 2022

老哥你解决了吗,我这设置那个负载也没啥用,超过20都是直接百分之百

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants