什么是container_cpu_cfs_throttled_seconds_total指标 [英] what's meaning the container_cpu_cfs_throttled_seconds_total metrics
问题描述
cadvisor具有两个指标 container_cpu_cfs_throttled_seconds_total 和 container_cpu_cfs_throttled_periods_total
cadvisor has two metrics container_cpu_cfs_throttled_seconds_total and container_cpu_cfs_throttled_periods_total
我对这意味着什么感到困惑.
I have confuse what does that means ..
我发现大约有两个解释:
I have found about two explain:
-
容器以cpu限制运行,当容器cpu超过限制时, 容器将被限制",并添加时间到 container_cpu_cfs_throttled_seconds_total
container run with cpu limit, when container cpu over limit , the container will be "throttled" and add time to container_cpu_cfs_throttled_seconds_total
that means :
(1). only container cpu over limit, rate(container_cpu_cfs_throttled_seconds_total) > 0.
(2). we can use this metrics to alert container cpu over limit ...
当主机处于高CPU压力时,它将限制"具有POD QoS的容器(保证> Burstable>尽力而为)...
when host in heavy cpu pressure, it will "throttled" container with POD QoS(Guaranteed > Burstable > Best-Effort) ...
that means :
(1). container_cpu_cfs_throttled_seconds_total will add has no relate with how many cpu container used and cpu limit ..
(2). this metrics can not to alert container cpu over limit ..
推荐答案
让我们说在machine1上运行的httpbin容器.可以说,httbin在其部署中设置了一个限制,以最多使用1个CPU.而且machine1有2个CPU.它使httpbin可以使用一半的可用空间.
Lets say httpbin container running on machine1. Lets say httbin has a limit set in it's deployment to use maximum of 1 CPU. And machine1 has 2 CPUs. It makes httpbin to use half the available.
如果httpbin容器尝试使用1个以上的CPU,则kubernetes不会杀死该容器.它将节流.如果这种情况经常发生,则您可能希望获得有关此情况的警报并修复部署. 另一种情况是,如果machine1中有多个容器,并且缺少CPU资源,那么它将限制它拥有的所有容器.
If httpbin container is trying to use more than 1 CPU, kubernetes will not kill the container. It will throttle it. If it is happening frequently, you may want to get alerted on that and fix the deployment. Another scenario is, if there are multiple containers in machine1 and if there is a lack of CPU resource, then it will throttle all containers it has.
container_cpu_cfs_throttled_seconds_total是容器被限制的总持续时间,以秒为单位. container_cpu_cfs_throttled_periods_total是节流时间间隔的数量
container_cpu_cfs_throttled_seconds_total is the Total time duration the container has been throttled in seconds. container_cpu_cfs_throttled_periods_total is the Number of throttled period intervals
这篇关于什么是container_cpu_cfs_throttled_seconds_total指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!