In the Linux kernel, only the cgroup v2 interface supports the Pressure Stall Information (PSI) feature. Alibaba Cloud Linux 2 supports the PSI feature for the cgroup v1 interface in the 4.19.81-17.al7 kernel version and later to allow you to monitor the CPU, memory, and I/O performance. This topic describes how to enable the PSI feature for the cgroup v1 interface and query relevant information.
Background information
PSI is a kernel feature that can be used to monitor the CPU, memory, and I/O performance.
For more information about the PSI feature, see the Documentation/accounting/psi.txt
kernel document. This kernel document is contained in the Debuginfo package and source
code package of Alibaba CloudLinux 2. For information about how to download the Debuginfo
package and source code package, see Use Alibaba Cloud Linux 2.
Enable the PSI feature for the cgroup v1 interface
By default, the PSI feature is disabled for the cgroup v1 interface. You can perform the following steps to enable the PSI feature:
Check whether the PSI feature is enabled for cgroup v1
/proc/cmdline
of the kernel: cat /proc/cmdline | grep "psi=1 psi_v1=1"
Query the monitoring data of the CPU, memory, and I/O performance
cat /sys/fs/cgroup/cpuacct/cpu.pressure
cat /sys/fs/cgroup/cpuacct/memory.pressure
cat /sys/fs/cgroup/cpuacct/io.pressure