Hi,
Please have a look at the look at the below top
and sar
commands.
top -bn1 | grep load | awk '{printf "CPU Load: %.2f\n", $(NF-2)}'
CPU Load: 0.52
sar -u 1 1
Linux 3.10.0-514.16.1.el7.x86_64 (mymac) 06/01/2017 _x86_64_ (2 CPU)
03:27:40 PM CPU %user %nice %system %iowait %steal %idle
03:27:41 PM all 12.17 0.00 4.23 0.00 0.00 83.60
Average: all 12.17 0.00 4.23 0.00 0.00 83.60
Question 1: What is the difference between the CPU load shown by the top
command and that shown by the sar
command ?
Question 2: How can I get sar
command to shown the same value as top
?