A nice way to get system load

Since Linux 5.2, there is a new metric in the hood: Pressure Stall Information (PSI).

Currently it supplies 3 ciritical metrics from kernel: CPU, IO and memory. You can find the values simply by looking to files under /proc/pressure folder. I am not going to try explaining it in detail, since this page already does that pretty good.

I’ve found it way better than just the load metric because of granularity. And since I know my workstation bottleneck is CPU, I’ve quickly written a simple helper script via Python to show it on my systray.

It prints the relative CPU pressure since last run by saving it under /tmp. Helped me a lot, maybe someone else would find it useful: