calculate cpu utilization

How to Calculate CPU Utilization in Linux

Last updated on March 13th, 2021 at 03:21 am

Sometimes you may need to measure CPU usage or find CPU utilization in Linux. Here’s how to calculate CPU utilization in Linux.

How to Calculate CPU utilization in Linux

Here’s how to check CPU utilization in Linux. CPU usage is calculated using top command

$ top

You will see an output like the one below.

In it, you will see a line %Cpu(s)… This contains CPU utilization values. Among them CPU idle time = 81.7% (with id suffix after it).

CPU Utilization = 100 – CPU idle time

In our case,

CPU utilization = 100 – 81.7 = 18.3%

You can also use other utilities like mpstat, sar and iostat to find CPU utilization.

Hopefully, this article will help you calculate CPU utilization in Linux.