【问题标题】:Cannot find CPU frequency of Google Compute Engine VM找不到 Google Compute Engine 虚拟机的 CPU 频率
【发布时间】:2021-04-17 07:52:42
【问题描述】:

我想在 Google Compute Engine 上使用虚拟机实例 (Debian) 的 Prometheus 监控系统和应用程序指标。其中包括 CPU 频率,Prometheus 从/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 中抓取的。然而这并不存在。

我还检查了watch -n 0.1 "cat /proc/cpuinfo | grep -i mhz",这是不变的。此外,我可以使用 GCP 的 Monitoring 选项卡查看结果,但我需要比 1 分钟更细的间隔。

有谁知道我如何将 CPU 频率暴露给 Prometheus?

干杯, 马蒂亚斯

【问题讨论】:

    标签: linux google-compute-engine prometheus


    【解决方案1】:

    Compute Engine 在虚拟化环境中运行,这就是为什么 /cpufreq 不可用以及为什么像 hwinfodmidecodelscpu 这样的工具无论负载如何都会提供静态读取。

    解决方法是使用Monitoring API 以您想要的时间间隔提取 CPU 利用率数据。

    【讨论】:

      猜你喜欢
      • 2016-03-12
      • 2018-12-27
      • 2020-09-13
      • 2017-01-05
      • 2020-01-29
      • 1970-01-01
      • 2016-03-13
      • 2015-10-23
      • 1970-01-01
      相关资源
      最近更新 更多