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

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.

主站蜘蛛池模板: 鄯善县| 曲周县| 堆龙德庆县| 佳木斯市| 汉源县| 新干县| 城固县| 武宁县| 阳东县| 栾城县| 大连市| 颍上县| 南雄市| 庆城县| 雷山县| 汽车| 池州市| 苏州市| 罗山县| 宝坻区| 西盟| 中超| 庆城县| 松潘县| 天柱县| 沐川县| 崇阳县| 竹山县| 武汉市| 荆门市| 枞阳县| 乐亭县| 宣汉县| 治县。| 名山县| 靖江市| 宜兰市| 翁源县| 乳源| 邹平县| 西和县|