要计算容器内可分获得的内存,类似于CentOS 7中的available值,你可以使用以下公式:

可分获得的内存 = 容器内存使用量 - 容器内存缓存 - 容器内存RSS

其中,以下指标可以用于计算:

  • container_memory_usage_bytes:容器内存使用量,表示容器正在使用的内存总量。
  • container_memory_cache:容器内存缓存,表示容器使用的缓存内存。
  • container_memory_rss:容器内存RSS(Resident Set Size),表示容器当前使用的物理内存。
  • container_memory_failcnt:容器内存失败计数器,表示容器尝试分配内存但失败的次数。

请注意,这个计算仅提供了一个近似值,因为容器内存使用是动态变化的。

prometheus监控容器时以下几个指标:container_memory_cache container_memory_rss container_memory_failcnt container_memory_failures_total container_memory_mapped_file container_memory_max_usage_bytes container_mem

原文地址: https://www.cveoy.top/t/topic/ihMZ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录