官术网_书友最值得收藏!

  • The DevOps 2.2 Toolkit
  • Viktor Farcic
  • 195字
  • 2021-06-24 18:46:24

Using memory reservations and limits in Prometheus

Metrics obtained through cAdvisor are not restricted to actual usage. We have, among others, metrics based on container specs. We can, for example, retrieve memory limits with the metric container_spec_memory_limit_bytes.

Please type container_spec_memory_limit_bytes{container_label_com_docker_stack_namespace!=""} in the Expression field and click the Execute button. The result should be straight lines that represent memory limits we defined in our stacks.

The usage of the container_label_com_docker_stack_namespace label is important. We used it to filter the metrics so that only those that come from the stacks are included. That way, we excluded root metrics from cAdvisor that provide summarized totals.

In Prometheus, memory limits are not very useful in themselves. However, if we combine them with the actual memory usage, we can get percentages that can provide indications of the health of our system.

Please type container_memory_usage_bytes{container_label_com_docker_stack_namespace!=""} / container_spec_memory_limit_bytes{container_label_com_docker_stack_namespace!=""} * 100 in the Expression field and click the Execute button.

Figure 4-7: Graph percentages based on memory limits and the actual usage

The result consists of percentages based on memory limits and the actual usage. These should all be below 60%. We will leverage this information later when we start working on alerts.

主站蜘蛛池模板: 安庆市| 凤山市| 治多县| 葵青区| 额尔古纳市| 师宗县| 清徐县| 龙泉市| 敦化市| 凉城县| 抚顺县| 承德县| 镇沅| 监利县| 商河县| 林西县| 玉门市| 白水县| 老河口市| 四平市| 西盟| 兴仁县| 新安县| 高阳县| 岳阳县| 峨边| 宝丰县| 昌都县| 辛集市| 德保县| 晋城| 林州市| 遂宁市| 汾西县| 黄石市| 班戈县| 阜康市| 调兵山市| 龙陵县| 新宾| 固阳县|