SYSTEM MONITORING PERFORMANCE

Some important perfomance measurement command of linux and their description
============================================================================

Sar utility
==========

Command to find the cpu usage 6 times in per 5 seconds statics with the process number in Queue

sar -q 5 6

10:12:36 AM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
10:12:41 AM         6      1300      1.37      1.03      0.84
10:12:46 AM         3      1298      1.34      1.03      0.84
10:12:51 AM         2      1300      1.47      1.06      0.85
10:12:56 AM         4      1298      1.59      1.09      0.86
10:13:01 AM         2      1269      1.55      1.09      0.86
10:13:06 AM         0      1262      1.66      1.12      0.87
Average:            3      1288      1.50      1.07      0.85

Command to find system spending time on process and time its idle

sar –u 30 6

hari@hari-desktop:~$ sar -u 5 6
Linux 3.11.0-18-generic (hari-desktop)     Thursday 17 July 2014     _i686_    (4 CPU)

10:36:57  IST     CPU     %user     %nice   %system   %iowait    %steal     %idle
10:37:02  IST     all      8.27      0.00      0.75      1.55      0.00     89.42
10:37:07  IST     all      4.11      0.00      0.40      0.45      0.00     95.03
10:37:12  IST     all      5.14      0.00      0.30      0.00      0.00     94.56
10:37:17  IST     all      6.72      0.00      0.56      0.40      0.00     92.32
10:37:22  IST     all      4.26      0.00      0.50      0.20      0.00     95.04
10:37:27  IST     all      5.37      0.00      0.65      0.15      0.00     93.83
Average:        all      5.64      0.00      0.53      0.46      0.00     93.37

TOP COMMAND

Below the -bi command line option given to top tells it to go into batch-mode, instead of full-screen-mode, and to ignore idle processes. The -d30 and the -n7 instructs top to produce 7 sets of output with a delay of 30 seconds between them. The output above is the last of 7 sets of output top produced

top –bi –d30 –n7

We can verify this statement by using the -P ALL command line option to make sar report the CPU utilization on a per processor basis as well as the averaged values.

hari@hari-desktop:~$ sar -P ALL -u 5 6
Linux 3.11.0-18-generic (hari-desktop)     Thursday 17 July 2014     _i686_    (4 CPU)

10:39:54  IST     CPU     %user     %nice   %system   %iowait    %steal     %idle
10:39:59  IST     all      5.87      0.00      0.30      0.20      0.00     93.63
10:39:59  IST       0      4.01      0.00      0.40      0.00      0.00     95.59
10:39:59  IST       1     13.25      0.00      0.20      0.00      0.00     86.55
10:39:59  IST       2      1.20      0.00      0.20      0.00      0.00     98.60
10:39:59  IST       3      5.03      0.00      0.40      0.80      0.00     93.76

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s