It’s rather trivial task to get information about how much of CPU time is consumed by Linux operating system, its components or various software it runs, but thankfully there are numerous utilities making it possible to get it. Some of them are included into certain Linux distribution, other aren’t but most of tools listed below can be used to find out CPU utilization statistics:

1. top

top is very old and important core utility coming with almost any Linux and Unix operating systems. It shows real-time system resources utilization (CPU, RAM, swap file etc.) to administrators via console, here is the part of it’s output:

top - 16:05:38 up 3 days,  6:08,  2 users,  load average: 0.54, 0.54, 0.61
Tasks: 100 total,   2 running,  98 sleeping,   0 stopped,   0 zombie
Cpu(s):  5.3%us,  1.0%sy,  0.0%ni, 93.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    515984k total,   497928k used,    18056k free,    13988k buffers
Swap:  1502068k total,    92956k used,  1409112k free,   129096k cached

As this tool provides a lot of useful information, it makes sense to read its manual page: type man top.

2. atsar

sar, atsar are other old tools providing system activity reports including CPU load we need. Here is an example of sar’s usage:

viper@viper-desktop:~$ sar -u 2 5
Linux  viper-desktop  2.6.20-17-generic  #2 SMP Mon Jun 9 22:08:13 UTC 2008  i686  07/04/2008
16:13:58  cpu %usr %nice   %sys %irq %softirq    %wait %idle             _cpu_
16:14:00  all    3     0      0    0        0        1    97
16:14:02  all    0     0      0    0        0        0    99
16:14:04  all    0     0      0    0        0        0   100
16:14:06  all   23     0      0    0        0        0    76
16:14:08  all    0     0      0    0        0        0   100

As you might see CPU utilization was almost 0% for two seconds after the command was executed. BTW, here is the description of the options sar was started with:

-u showed statistics about CPU utilization (average and per cpu) with 5 intervals of 2 seconds.

3. ps

ps is one the most used core utilities every Linux or Unix administrator uses as this utility with short name shows processes run in the system. If you need to get information about how much CPU or RAM resources are consumed by certain process, just run this:

viper@viper-desktop:~$ ps u 23988
viper 23988 0.0 0.6 5760 3280 pts/0 Ss 15:54 0:00 bash

where 23988 is PID of the process (can be get from the output of ps ax).

Of course it makes sense to read manuals of above mentioned commands ps, top, sar, atsar, iostat. Good luck!




  1. December 16, 2008  6:28 pm by Ajith Reply

    suitable for beginners

  2. February 5, 2011  10:44 pm by peliculas online gratis sin cortes Reply

    Now you might have your new web site and also you’re eager to begin making some gross sales! However, how can you make sales if you happen to would not have excessive volumes of holiday makers to your web site?

  3. May 2, 2011  2:55 am by Caramel Corn Reply

    Good web site! I truly love how it is nice on my eyes it is. I am wondering how I might be notified whenever a new post has been made. I've subscribed to your RSS which may do the trick? Have a great day!

  4. May 2, 2011  4:55 pm by brazil wax Reply

    I’ve recently started a website, and the info you offer on this website has been greatly useful to me. Thanksso much for all of your time & work.

  5. March 30, 2012  7:42 pm by fruit mocking party Reply

    With havin so much content and articles do you ever run into any issues of plagorism or copyright violation? My website has a lot of unique content I've either authored myself or outsourced but it seems a lot of it is popping it up all over the web without my authorization. Do you know any methods to help reduce content from being stolen? I'd certainly appreciate it.

Leave a reply


Your email address will not be published.