linux - kubectl top node 输出与 Linux free 命令不匹配

标签 linux kubernetes

我有一个一对一的 Kubernetes 集群,指标服务器报告的内存使用情况似乎与 free 命令显示的内存使用情况不同

# kubectl top nodes
NAME          CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
<node_ip>   1631m        10%    13477Mi         43%

# free -m
              total        used        free      shared  buff/cache   available
Mem:          32010       10794         488          81       20727       19133
Swap:         16127        1735       14392

差异显着 ~ 3 GB。

我还在 3 节点集群上测试过这个,问题也存在于那里:

# kubectl top nodes
NAME          CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
<node_ip1>   1254m        8%     26211Mi         84%
<node_ip2>   221m         1%     5021Mi          16%
<node_ip3>   363m         2%     8731Mi          28%
<node_ip4>   1860m        11%    20399Mi         66%

# free -m (this is on node 1)
              total        used        free      shared  buff/cache   available
Mem:          32010        5787         369        1676       25853       24128
Swap:         16127           0       16127

为什么会有差异?

最佳答案

可以找到您问题的答案here .它是重复的,因此您可以从 StackOverflow 中删除此帖子。

关于linux - kubectl top node 输出与 Linux free 命令不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58086664/

相关文章:

kubernetes - 在 kubernetes preStop 钩子(Hook)之后,是否仍然遵守终止GracePeriodSeconds?

kubernetes - 使用HTTP POST将OpenTSDB写入Bigtable不起作用(使用Kubernetes(

docker - 无法从 k8s/minikube 中的 GCR 中提取图像

docker - 使用Kubernetes进行Elastic Search设置

c++ - 在 Linux 环境中开发 Visual Studio C++ 项目

linux - Bash:引用字符串中的变量替换看起来像暮光之城中的东西

c - 如何在 Linux 中重新绑定(bind) udp 套接字

linux - 尽管文件在那里,但 Git 无法在远程找到文件

客户端服务器套接字编程

kubernetes - 如何使用 “kubectl”命令而不是 “sudo kubectl”