- 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.

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.
- 教練式溝通:直達人心的管理口才技巧
- 超越他者,成為主體:人民文藝視野下中國當代作家知識分子敘事研究(1949—1966)
- 城市與區(qū)域規(guī)劃研究(第10卷第1期,總第26期)
- 珠江論叢(2016年第1輯/總第11輯)
- 中國國家賠償論
- EViews統(tǒng)計分析與實驗指導(視頻教學版)
- 每天讀點社會學
- 歷史的回歸:21世紀的沖突、遷徙和地緣政治
- 青春的足跡:華東理工大學附屬中學初高三畢業(yè)班學生專輯
- 科普資源開發(fā)與創(chuàng)新實踐
- 中國數(shù)字人文發(fā)展報告(第一輯)
- 半世繁華半世劫:宜紅舊事
- 在線評論情感傾向的成因及影響研究
- 人才數(shù)據(jù)分析指南:理念、方法與實戰(zhàn)技巧
- 奮進的歷程:青海省社會科學院建院四十周年