An abbreviation of SAR is System Activity Reporter which is an important tool for system administrators to get the performance overview of the server at different point of time.

Using sar commaned, we can know the cpu, memory , disk etc, utilization for the current or for the past.

CPU usage of all cpu’s

[root@rhel6-1 ~]# sar -u 2 5
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:26:46 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
02:26:48 PM     all      0.00      0.00      0.00      0.00      0.00    100.00
02:26:50 PM     all      0.00      0.00      0.00      0.00      0.00    100.00
02:26:52 PM     all      0.00      0.00      0.00      0.00      0.00    100.00
02:26:54 PM     all      0.00      0.00      0.00      0.00      0.50     99.50
02:26:56 PM     all      0.00      0.00      0.50      0.00      0.00     99.50
Average:        all      0.00      0.00      0.10      0.00      0.10     99.80
[root@rhel6-1 ~]# 

CPU Usage of Individual CPU or Core

[root@rhel6-1 ~]# sar -P ALL 1 1
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:14:10 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
02:14:11 PM     all      0.00      0.00      0.00      0.00      0.00    100.00
02:14:11 PM       0      0.00      0.00      0.00      0.00      0.00    100.00

Average:        CPU     %user     %nice   %system   %iowait    %steal     %idle
Average:        all      0.00      0.00      0.00      0.00      0.00    100.00
Average:          0      0.00      0.00      0.00      0.00      0.00    100.00
[root@rhel6-1 ~]# 

Memory Free and Used (sar -r)

[root@rhel6-1 ~]# sar -r 1 3
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)>

02:19:13 PM kbmemfree kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit
02:19:14 PM    837980    182412     17.88     55032     54104    281164      9.11
02:19:15 PM    837980    182412     17.88     55032     54104    281164      9.11
02:19:16 PM    837980    182412     17.88     55032     54104    281164      9.11
Average:       837980    182412     17.88     55032     54104    281164      9.11

Swap Space Used

[root@rhel6-1 ~]# sar -S 1 3
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:19:27 PM kbswpfree kbswpused  %swpused  kbswpcad   %swpcad
02:19:28 PM   2064376         0      0.00         0      0.00
02:19:29 PM   2064376         0      0.00         0      0.00
02:19:30 PM   2064376         0      0.00         0      0.00
Average:      2064376         0      0.00         0      0.00

Overall I/O Activities

[root@rhel6-1 ~]# sar -b 1 3
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:19:33 PM       tps      rtps      wtps   bread/s   bwrtn/s
02:19:34 PM      0.00      0.00      0.00      0.00      0.00
02:19:35 PM      0.00      0.00      0.00      0.00      0.00
02:19:36 PM      0.00      0.00      0.00      0.00      0.00
Average:         0.00      0.00      0.00      0.00      0.00

Individual Block Device I/O Activities

[root@rhel6-1 ~]# sar -d 1 1
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:19:39 PM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
02:19:40 PM    dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:19:40 PM  dev252-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:19:40 PM  dev253-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:19:40 PM  dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:19:40 PM  dev253-2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
Average:       dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:     dev252-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:     dev253-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:     dev253-2      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
[root@rhel6-1 ~]# sar -p -d 1 1
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:19:45 PM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
02:19:46 PM       sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:19:46 PM       vda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:19:46 PM vg_rhel61-lv_root      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:19:46 PM vg_rhel61-lv_swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:19:46 PM vg_scsi-lv_iscsi      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:          DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
Average:          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:          vda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:    vg_rhel61-lv_root      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:    vg_rhel61-lv_swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:    vg_scsi-lv_iscsi      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
[root@rhel6-1 ~]# sar -w 1 3
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:19:54 PM    proc/s   cswch/s
02:19:55 PM      0.00     77.78
02:19:56 PM      0.00     82.00
02:19:57 PM      0.00     78.22
Average:         0.00     79.33
[root@rhel6-1 ~]# sar -q 1 3
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:19:59 PM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
02:20:00 PM         0       180      0.00      0.00      0.00
02:20:01 PM         0       180      0.00      0.00      0.00
02:20:02 PM         0       180      0.00      0.00      0.00
Average:            0       180      0.00      0.00      0.00
[root@rhel6-1 ~]# sar -n DEV 1 1
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/16/2017 	_x86_64_	(1 CPU)

02:20:05 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
02:20:06 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
02:20:06 PM      eth0      1.00      0.00      0.05      0.00      0.00      0.00      0.00
02:20:06 PM      eth1      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Average:        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
Average:           lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:         eth0      1.00      0.00      0.05      0.00      0.00      0.00      0.00
Average:         eth1      0.00      0.00      0.00      0.00      0.00      0.00      0.00
[root@rhel6-1 ~]# sar -q -f /var/log/sa/sa15 -s 10:00:01
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/15/2017 	_x86_64_	(1 CPU)

02:30:01 PM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
02:40:01 PM         1       114      1.00      1.00      1.00
02:50:01 PM         1       114      1.00      1.00      1.00
03:00:01 PM         1       114      1.00      1.00      1.00
03:10:01 PM         1       114      1.00      1.00      1.00
07:40:01 PM         1       114      1.00      1.00      1.00
07:50:01 PM         1       114      1.00      1.00      1.00
08:00:01 PM         1       114      1.00      1.00      1.00
08:10:01 PM         1       114      1.00      1.00      1.00
08:20:01 PM         1       114      1.00      1.00      1.00
08:30:01 PM         1       114      1.00      1.00      1.00
Average:            1       114      1.00      1.00      1.00
[root@rhel6-1 ~]# sar -q -f /var/log/sa/sa15 -s 10:00:01 | head -n 10
Linux 2.6.32-431.el6.x86_64 (rhel6-1) 	05/15/2017 	_x86_64_	(1 CPU)

02:30:01 PM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
02:40:01 PM         1       114      1.00      1.00      1.00
02:50:01 PM         1       114      1.00      1.00      1.00
03:00:01 PM         1       114      1.00      1.00      1.00
03:10:01 PM         1       114      1.00      1.00      1.00
07:40:01 PM         1       114      1.00      1.00      1.00
07:50:01 PM         1       114      1.00      1.00      1.00
08:00:01 PM         1       114      1.00      1.00      1.00

LEAVE A REPLY

Please enter your comment!
Please enter your name here