cadvisor 有两个指标container_cpu_cfs_throttled_seconds_total和container_cpu_cfs_throttled_periods_total
我很困惑这是什么意思..
我找了两个解释一下?
容器以 cpu 限制运行,当容器 cpu 超过限制时,容器将被“节流”并向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 ...
Run Code Online (Sandbox Code Playgroud)当主机处于沉重的 cpu 压力下时,它将使用 POD QoS(保证 > 突发 > 尽力而为)“节流”容器......
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 ..
Run Code Online (Sandbox Code Playgroud)Dav*_*Far 41
container_cpu_cfs_throttled_seconds_total
是所有限制持续时间的总和,即容器被限制的持续时间,即停止使用CFS Cgroup 带宽控制。
由于每个停止的线程都会将其限制持续时间添加到container_cpu_cfs_throttled_seconds_total
,因此这个数字可能会变得很大并且对您没有帮助(除非您有已知的固定数量的线程)。
这就是为什么 CPU 限制警报通常基于指标throttled percentage
:= container_cpu_cfs_throttled_periods_total / container_cpu_cfs_periods_total
,即容器运行但被限制的 CPU 周期百分比(停止运行整个 CPU 周期)。
更详细的内容可以观看这篇关于CFS和CPU调度的演讲,或者阅读相应的文章。
小智 9
假设 httpbin 容器在 machine1 上运行。假设 httbin 在其部署中设置了最多使用 1 个 CPU 的限制。machine1 有 2 个 CPU。它使 httpbin 使用一半的可用空间。
如果 httpbin 容器尝试使用超过 1 个 CPU,kubernetes 将不会终止该容器。它会扼杀它。如果这种情况经常发生,您可能需要收到警报并修复部署。另一种情况是,如果 machine1 中有多个容器,并且缺乏 CPU 资源,那么它将限制其拥有的所有容器。
container_cpu_cfs_throttled_seconds_total 是容器被限制的总持续时间(以秒为单位)。container_cpu_cfs_throttled_periods_total 是节流周期间隔数
归档时间: |
|
查看次数: |
7521 次 |
最近记录: |