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

Greater than 100% CPU utilization is not documented #73

Open
SmitaPatankar opened this issue Sep 15, 2020 · 2 comments
Open

Greater than 100% CPU utilization is not documented #73

SmitaPatankar opened this issue Sep 15, 2020 · 2 comments

Comments

@SmitaPatankar
Copy link

SmitaPatankar commented Sep 15, 2020

Steps to Reproduce:

  • Create a container that needs high CPU utilization at times, but limit the "cpus" for it.
  • Run the container.
  • Run this command in while loop in shell script and print output to some file.
    check_docker --connection /var/run/docker.sock --containers all --cpu 80:95

My Setup:

  • My server has 2 CPUs.
  • My container needs high CPU utilization at start because of many supervisor services getting auto started at once, but I have limited the "cpus" to "0.75".

Output at times, initially:

CRITICAL: {containername} cpu is 103%
|{containername}_cpu=103;80;95;0;100

Reason behind the output:
It seems that when CPU utilization exceeds the limit slightly, it gets under control i.e. there is some margin.

Additional logs:

docker inspect {containername}|grep -i cpu
            "CpuShares": 0,
            "NanoCpus": 0,
            "CpuPeriod": 100000,
            "CpuQuota": 75000,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "CpuCount": 0,
            "CpuPercent": 0,

Issue:
The documentation(README file) only talks about the values from 0-100, not beyond that.
In this case, we should ideally set the warning:critical to something like 110:125 instead.

@timdaman
Copy link
Owner

Hmm, that is an issue I had not considered. Thanks for sharing.

I just want to ensure my change makes sense to you. All I am doing is updating the help string and documentation to remove the suggestion of a 0-100% range. That seems like it should be enough as well as being a bit more accurate since I do allow values bigger than 100.

Does that sound right to you?

@SmitaPatankar
Copy link
Author

Yes, sounds good. Thanks.

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

No branches or pull requests

2 participants