Pressure Stall Information (PSI) is a kernel feature that monitors CPU, memory, and I/O resource pressure. The Linux kernel provides PSI only for cgroup v2 by default. Alibaba Cloud Linux 2 (kernel 4.19.81-17.al7 and later) and Alibaba Cloud Linux 3 extend PSI support to the cgroup v1 interface.
Enable PSI for the cgroup v1 interface
The psi=1 kernel argument enables PSI for cgroup v2. To also enable PSI for cgroup v1, add both psi=1 and psi_v1=1 kernel arguments.
Enable PSI for
cgroup v1.sudo grubby --update-kernel="/boot/vmlinuz-$(uname -r)" --args="psi=1 psi_v1=1"Restart the instance for the change to take effect.
WarningRestarting stops the instance briefly and may interrupt running services. Back up critical data before restarting, and schedule the restart during off-peak hours.
sudo rebootVerify that PSI is enabled for
cgroup v1.cat /proc/cmdline | grep "psi=1 psi_v1=1"If the output contains these parameters, PSI is enabled for
cgroup v1.
Query CPU, memory, and I/O pressure data
With PSI enabled, CPU, memory, and I/O pressure data is available under the cgroup v1 cpuacct controller.
Run the following commands to view pressure metrics.
cat /sys/fs/cgroup/cpuacct/cpu.pressure
cat /sys/fs/cgroup/cpuacct/memory.pressure
cat /sys/fs/cgroup/cpuacct/io.pressure