Software‎ > ‎

Linux CPU Monitor


Getting the CPU(s) load reading in percents, similar to what is presented by top. Specifically, getting the user space instantaneous CPU consumption, which is the 3rd line ("1.2%us") in the example below: 

Linux top utility example


Although available in top and system monitor, the CPU load is not written anywhere. Therefore, it is not easy to get this reading in conventional programming languages.
There is also a serious misconception regarding /proc/loadavg (and uptime). Many people think that the number written there is the CPU load, while in practice it is not even a percentage of anything. In addition, it is very slow to respond to sudden load increase, because it presents average values over 1 minute and more.