---
# System prepended metadata

title: 查找 OpenShift CoreOS cache usage

---

# 查找 OpenShift CoreOS cache usage

###### tags: 

# 1. Grafana dashboard 搭配內建Node exporter
用此儀表板搭配openshift `prometheus當做datasource`可抓取node的total memory usage
https://grafana.com/grafana/dashboards/405-node-exporter-server-metrics/

![](https://i.imgur.com/uMflxvj.png)


# 2. Grafana dashboard 搭配process exporter (需額外安裝process exporter)

a. 於OpenShift 安裝process exporter
https://github.com/Avielyo10/prom

b. customer grafana安裝儀表板
https://grafana.com/grafana/dashboards/8378-system-processes-metrics/

實際OpenShift畫面

![](https://i.imgur.com/l5ybrvG.png)

![](https://i.imgur.com/T9UwpMm.png)
![](https://i.imgur.com/s2KTUma.png)


## OCP 預設node的記憶體用量計算方式

```
    - expr: |
        1 - (
          (
            node_memory_MemAvailable_bytes{job="node-exporter"}
            or
            (
              node_memory_Buffers_bytes{job="node-exporter"}
              +
              node_memory_Cached_bytes{job="node-exporter"}
              +
              node_memory_MemFree_bytes{job="node-exporter"}
              +
              node_memory_Slab_bytes{job="node-exporter"}
            )
          )
        /
          node_memory_MemTotal_bytes{job="node-exporter"}
        )
      record: instance:node_memory_utilisation:ratio
```