Monday, August 8, 2011

Hey Dude !!! Look into the CPU utilization of the Linux box

Bottleneck....aaahhh. Its a pain for the system administrators.

Whenever a Linux system CPU is occupied by a process, it is unavailable for processing other requests. Rest of pending requests must wait till CPU is free. This becomes a bottleneck in the system. Following command will help you to identify CPU utilization, so that you can troubleshoot CPU related performance problems.
Finding CPU utilization is one of the important tasks. Linux comes with various utilities to report CPU utilization. With these commands, you will be able to find out:
* CPU utilization
* Display the utilization of each CPU individually (SMP cpu)
* Find out your system's average CPU utilization since the last reboot etc
* Determine which process is eating the CPU(s)
We can make use of the tools like mpstat and iostat to more accurately find the issues related to the cpu overload. But before we make use of these utilities, we need to download it from the repos. Kind following the following steps in order to download it.

[root@localhost~:]#apt-get update
[root@localhost~:]#apt-get install sysstat

This will download the utils and put in the default folder (here I presumed that it’s a ubuntu system).

What next…Let’s use the command:
[root@localhost~:]#mpstat
Linux 2.4.27-1-686-smp (test) 16/11/05

09:05:11 CPU %user %nice %system %iowait %irq %soft %idle intr/s

09:05:11 all 0.01 0.00 0.03 0.00 0.00 0.00 99.96 106.03

No comments:

Post a Comment