Greater than 100% CPU utilization is not documented
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.
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?
Yes, sounds good. Thanks.