作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图理解关于 的 container_memory_rss 或 container_memory_working_set_bytes node_memory_used 即(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes)
这是我的意思
PROMQL 1:
sum(container_memory_rss) by (instance) / 1024 / 1024 / 1024
{instance="172.19.51.8:10250"} 7.537441253662109
PROMQL 2:
sum(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes) by (instance) / 1024 / 1024 / 1024
{instance="172.19.51.8:9100"} 2.2688369750976562
PROMQL 3:
sum(container_memory_working_set_bytes) by (instance) / 1024 / 1024 / 1024
{instance="172.19.51.8:10250"} 9.285114288330078
PROMQL 4:
sum(node_memory_MemAvailable_bytes) by (instance) / 1024 / 1024 / 1024
{instance="172.19.51.8:9100"} 13.356605529785156
因此,如果 Pod 始终在 Node.js 上运行。我不明白为什么是
container_memory_rss 或
container_memory_working_set_bytes 超过
node_memory_used
最佳答案
tl;博士
使用容器名称过滤器排除总计:
# you may have a different label for container name
sum(container_memory_rss{name!=""}) by (instance) / 2^30
解释
sort_desc(sum(container_memory_rss{instance="ip-192-168-104-46"}) by (name)) / 2^30
{} 3.9971389770507812
{name="prometheus"} 0.6084518432617188
{name="cluster-autoscaler"} 0.04230499267578125
实际上有几个没有名字的条目,但它们都有一个
id
:
sort_desc(sum(container_memory_rss{instance="ip-192-168-104-46"}) by (id)) / 2^30
# these do not have a container name
{id="/"} 1.1889266967773438
{id="/kubepods"} 0.900482177734375
{id="/kubepods/burstable"} 0.6727218627929688
{id="/system.slice/docker.service"} 0.07495498657226562
{id="/system.slice/kubelet.service"} 0.060611724853515625
# and this is an example id of a real container which has a name label
{id="/kubepods/burstable/pod562495f9-afa6-427e-8435-016c2b500c74/e73975d90b66772e2e17ab14c473a2d058c0b9ffecc505739ee1a94032728a78"} 0.6027107238769531
这些是每个
cgroup
的累积值.
cAdvisor
从
cgroups
获取统计信息如果你看它们,你会发现熟悉的实体:
# systemd-cgls -a
├─kubepods
│ ├─podc7dfcc4e-74fc-4469-ad56-c13fe5a9e7d8
│ │ ├─61a1a58e47968e7595f3458a6ded74f9088789a865bda2be431b8c8b07da1c6e
│ │ └─d47601e38a96076dd6e0205f57b0c365d4473cb6051eb0f0e995afb31143279b
│ ├─podfde9b8ca-ce80-4467-ba05-03f02a14d569
│ │ ├─9d3783df65085d54028e2303ccb2e143fecddfb85d7df4467996e82691892176
│ │ └─47702b7977bed65ddc86de92475be8f93b50b06ae8bd99bae9710f0b6f63d8f6
│ ├─burstable
│ │ ├─pod9ff634a5-fd2a-42e2-be27-7e1028e96b67
│ │ │ ├─5fa225aad10bdc1be372859697f53d5517ad28c565c6f1536501543a071cdefc
│ │ │ └─27402fed2e4bb650a6fc41ba073f9994a3fc24782ee366fb8b93a6fd939ba4d3
如果你总结了所有的直接 child ,比如
kubepods
,您将获得相同的值
kubepods
已。由于这些总数
sum(container_memory_rss) by (instance)
显示了实际资源利用率的数倍。
关于kubernetes - container_memory_rss 与使用的节点内存的关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68220372/
我试图理解关于 的 container_memory_rss 或 container_memory_working_set_bytes node_memory_used 即(node_memory_M
我需要监控在 kubernetes 集群上运行的容器内存使用情况。阅读一些文章后,有两个建议:“container_memory_rss”、“container_memory_working_set_
我是一名优秀的程序员,十分优秀!