cadvisor metrics container_memory_working_set_bytes vs container_memory_usage_bytes

 

之前查询container mem已经使用的mem,都是使用的是container_memory_usage_bytes,直到早上看到openshift监控平台在查询container mem usage的时候使用的container_memory_working_set_bytes

cadvisor官方给出的metrics文档:
https://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md

mem相关的指标

https://medium.com/faun/how-much-is-too-much-the-linux-oomkiller-and-used-memory-d32186f29c9d

https://blog.freshtracks.io/a-deep-dive-into-kubernetes-metrics-part-3-container-resource-metrics-361c5ee46e66

以上两篇文章有解释为什么用container_memory_working_set_bytes, 而不用container_memory_usage_bytes。

container_memory_usage_bytes包含了cache,如filesystem cache,当存在mem pressure的时候能够被回收。

container_memory_working_set_bytes 更能体现出mem usage,oom killer也是根据container_memory_working_set_bytes 来决定是否oom kill的。

sum(container_memory_working_set_bytes{name!~"POD"}) by (name)

disk io

sum(rate(container_fs_writes_bytes_total[5m])) by (container_name,device)
sum(rate(container_fs_reads_bytes_total[5m])) by (container_name,device)

net io

sum(rate(container_network_receive_bytes_total[5m])) by (name)
sum(rate(container_network_transmit_bytes_total[5m])) by (name)
  • 5
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值