Overview of the Memcg Exstat feature

更新时间:
复制 MD 格式

The Memcg Exstat feature adds two memory control group (memcg) statistical counters to Alibaba Cloud Linux. These counters help you diagnose memory throttling and reclamation latency at the cgroup level.

This feature is available on Alibaba Cloud Linux 2 (kernel 4.19.91-18.al7 and later) and Alibaba Cloud Linux 3 (kernel 5.10.134-12.al8 and later).

Statistical items

Both counters are exposed through the memory.exstat interface file. Each counter is recursive — a cgroup accumulates values from all its descendant cgroups. Neither counter appears in the memcg root directory.

CounterWhat it measuresUnit
wmark_min_throttled_msThrottling time in microseconds accumulated when memory pressure causes the offset global minimum watermark (set via memcg.exstat) to be exceeded. Part of the memcg global minimum watermark rating feature.Microseconds
wmark_reclaim_work_msTotal latency in microseconds caused by backend asynchronous reclamation (memcg kswapd), including both blocking time and working time during reclamation. Part of the memcg backend asynchronous reclaim feature.Microseconds

Verify the memory.exstat interface

Create a test cgroup under the memcg mount point (typically /sys/fs/cgroup/memory) to confirm the memory.exstat interface is available.

  1. Create a test directory.

    sudo mkdir /sys/fs/cgroup/memory/test
  2. Query the interface. If the interface is present, the output looks like the following:

    $ cat /sys/fs/cgroup/memory/test/memory.exstat
    wmark_min_throttled_ms 0
    wmark_reclaim_work_ms 0

Related topics