之前查询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)
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐