checking Linux CPU utilization


finding CPU utilization is one of the important tasks in systems administration. There are built-in and 3rd party tools that you can use to perform this task.

1. top – displays Linux tasks
this is the most common command used in getting CPU usage

#top

"the old good 'top' command"

"the old good 'top' command"

2. mpstat – display CPU individually and processors related stats.
In order to use this, package “sysstat” should be installed. you can use apt-get (debian-based) or yum (red-hat based) command to install it via internet

#yum install sysstat

#mpstat

#mpstat -P ALL

mpstat in action

mpstat in action

3. sar – Collect, report, or save system activity information.

#sar -u 3 7

sar in 3 secs interval & 7 times

sar in 3 secs interval & 7 times

4. ps – report a snapshot of the current processes.

#ps -eo pcpu,pid,user,args | sort -k 1 -r | head -20

who's eating ur cpu?

who's eating ur cpu?

5. iostat – Report  Central  Processing  Unit  (CPU)  statistics and
input/output  statistics  for  devices,  partitions   and   network
filesystems (NFS).

#iostat
#iostat -xtc 5 3

iostat output every 5 secs

iostat output every 5 secs

happy checking 🙂

linux top CLI iostat mpstat sysstat ps systems administration

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: