VM CPU使用率与GKE容器CPU使用率之间的差异 [英] Difference between VM CPU usage and GKE container CPU usage

查看:120
本文介绍了VM CPU使用率与GKE容器CPU使用率之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个节点的集群,每个节点是GCE上2个CPU的VM

I have a cluster of 2 nodes, each node is a VM of 2 CPU on GCE

以下是VM CPU使用率指标的图表 VM CPU

Here is the chart for VM CPU usage metric VM CPU

这是GKE容器中CPU使用率的图表

Here is the chart for CPU usage from GKE containers

GKE CPU

那么2个指标之间为什么会有很大的差异?还有为什么GKE的总CPU使用率可以高于4秒(因为我有4个核心) 集群节点

So why is there much difference between 2 metric? Also why total CPU usage of GKE can be higher than 4 seconds (because I have 4 cores ) Cluster nodes

PS1:我发现堆栈驱动程序监视中的图表存在错误"或某些错误.当我将图表更改为1w时,我得到了类似的内容 1w图表 如果我使用一维图表,那么它看起来像 一维图表

PS1 : I found that there is a "bug" or something is not perfect with the chart in stackdriver monitoring. When I change the chart to be 1w then I get something like this 1w chart And if I use 1d chart then it looks like 1d chart

所以现在我只剩下一个问题,为什么GKE容器的CPU总使用率比内核数高?

So now I only have one question left, why total CPU usage from GKE containers are higher than number of cores?

推荐答案

GCE将衡量VM的总体CPU使用率,其中包括正在运行的所有进程(容器,守护程序,操作系统开销等),而GKE容器指标仅显示根据特定的容器指标.容器是单个过程.

GCE will measure the overall CPU usage of a VM which includes all processes being run (containers, daemons, OS overhead, etc) whereas the GKE container metric only looks at specific container metrics. The container is a single process.

此外,您要查看的指标值不是利用率.利用率是按照百分比而不是 stackdriver指标参考页.您正在查看的图形的右侧显示秒数,但重要的值是图形左侧的秒数,应为百分比.

Also, the metric value you are looking at is not utilization; utilization is measured as a percentage, not in seconds as per the stackdriver metrics reference page. The graph you are looking at shows seconds on the right-hand side, but the important value is the one on the left of the graph which should be a percentage.

利用率是CPU使用率与可用CPU总数的百分比.在GCE级别上,这意味着OS V的所有进程所使用的CPU与分配的总CPU(2个CPU).对于容器,这是容器进程使用的CPU VS k8s分配的CPU.容器的总和将不会获得与VM相同的值,并且容器的CPU利用率有可能超过100%

The utilization is a percentage of CPU used Vs the total CPU available. At the GCE level this means the CPU used by all processes of the OS Vs the total CPU allotted (2 CPUs). For the container, this is the CPU used by the container process Vs the CPU allocated by k8s. The sum of the containers will not result in the same value as that of the VM, and it is possible for the container CPU utilization to go over 100%

这篇关于VM CPU使用率与GKE容器CPU使用率之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆