I am running Ubuntu 16.04 and my Linux kernel version is 4.4.0. How can I enable the kernel's PSI? Or is there a tool that is similar?
Pressure information for each resource is exported through the respective file in
The PSI command for your CPU is:
some avg10=0.00 avg60=0.00 avg300=0.00 total=0
and for memory and IO:
some avg10=0.00 avg60=0.00 avg300=0.00 total=0 full avg10=0.00 avg60=0.00 avg300=0.00 total=0
The “some” line indicates the share of time in which at least some tasks are stalled on a given resource.
The “full” line indicates the share of time in which all non-idle tasks are stalled on a given resource simultaneously. In this state actual CPU cycles are going to waste, and a workload that spends extended time in this state is considered to be thrashing. This has severe impact on performance, and it’s useful to distinguish this situation from a state where some tasks are stalled but the CPU is still doing productive work. As such, time spent in this subset of the stall state is tracked separately and exported in the “full” averages.
More detail can be found in my source, which I added as the link in the first graf of your query.
For "monitoring" you probably want a running display of current values. You can achieve this by employing
watch cat /proc/pressure/*
(although here it is difficult to discern what line shows which category)
watch "(echo CPU; cat /proc/pressure/cpu ; echo IO; cat /proc/pressure/io; echo MEMORY; cat /proc/pressure/memory)"
which displays something like
CPU some avg10=0.00 avg60=0.00 avg300=0.04 total=51646098 IO some avg10=0.00 avg60=0.00 avg300=0.09 total=20413087 full avg10=0.00 avg60=0.00 avg300=0.08 total=16237739 MEMORY some avg10=0.00 avg60=0.00 avg300=0.00 total=0 full avg10=0.00 avg60=0.00 avg300=0.00 total=0