简体   繁体   English

了解 GCP 监控中的 Kubernetes pod 资源利用率

[英]Understanding Kubernetes pod resource utilization in GCP monitoring

let's say I have the following resource requests:假设我有以下资源请求:

  • cpu 25m中央处理器 25 米
  • mem 256Mi内存 256Mi

And I have the following limits:我有以下限制:

  • cpu 1中央处理器 1
  • mem 1Gi内存 1Gi

And I have the following utilization我有以下用途

  • cpu 15.01%中央处理器 15.01%
  • mem 17.24%内存 17.24%

Question... Is utilization % of limits or % of requests?问题... 利用率是限制的百分比还是请求的百分比?

My presumption is it would be % of limits.我的假设是这将是限制的百分比。 So then if I want my cpu at 75% utilization I would just have to scale it down which would get me to 200m using the math below那么,如果我希望我的 CPU 利用率为 75%,我只需要按比例缩小它,使用下面的数学运算可以使我达到200m

(15.01%*1000)/0.75 = 200

[Update] [更新]

  • I was looking at GCP in the monitoring section of GKE pods我在 GKE pods 的监控部分查看 GCP

you are correct.你是对的。 kubectl top pod also presents the current usage in millicores, so it can also be used to calculate a possible limit reduction. kubectl top pod还以毫核为单位显示当前使用情况,因此它还可用于计算可能的限制减少量。

kubectl top pod  | grep prometheus-k8s | awk '{print $2}
405m

So I set my limit with.所以我设置了我的限制。 (405 * 100) / 75 = 540m (405 * 100) / 75 = 540m

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM