The SAR command extracts and writes to standard output records previously saved in a file. The SAR command only reports on local activities. Each time we need to run /usr/lib64/sa/sa1 to get status updated into /var/log/sa/sa27. To install SAR we need to install yum install sysstat
[root@ip-172-31-28-103 sa]# /usr/lib64/sa/sa1
[root@ip-172-31-28-103 sa]# sar
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
[root@rahul-linux1 ~]# sar --CPU Info
Linux 3.8.13-118.13.2.el6uek.x86_64 (rcdn9-emaas-rdb-001) 11/18/2016 _x86_64_ (120 CPU)
12:00:01 AM CPU %user %nice %system %iowait %steal %idle
12:10:01 AM all 1.86 0.00 0.75 0.02 0.00 97.37
12:20:02 AM all 2.20 0.00 0.93 0.02 0.00 96.85
12:30:01 AM all 1.96 0.00 0.79 0.02 0.00 97.23
12:40:01 AM all 1.81 0.00 0.73 0.01 0.00 97.45
12:50:01 AM all 2.52 0.00 1.10 0.02 0.00 96.36
01:00:01 AM all 1.67 0.00 0.75 0.02 0.00 97.56
01:10:01 AM all 2.23 0.00 0.85 0.02 0.00 96.90
01:20:01 AM all 1.85 0.00 0.76 0.01 0.00 97.37
01:30:01 AM all 1.81 0.00 0.73 0.02 0.00 97.44
[root@ip-172-31-28-103 sa]# sar -S --SWAP
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM kbswpfree kbswpused %swpused kbswpcad %swpcad
12:58:53 AM 0 0 0.00 0 0.00
12:59:08 AM 0 0 0.00 0 0.00
01:00:02 AM 0 0 0.00 0 0.00
01:01:42 AM 0 0 0.00 0 0.00
Average: 0 0 0.00 0 0.00
[root@ip-172-31-28-103 sa]# sar -b --I/O Details read, write, transaction, bytes read
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM tps rtps wtps bread/s bwrtn/s
12:58:53 AM 0.40 0.00 0.40 0.00 5.42
12:59:08 AM 0.07 0.00 0.07 0.00 1.13
01:00:02 AM 0.30 0.00 0.30 0.00 4.39
01:01:42 AM 0.29 0.00 0.29 0.00 3.81
Average: 0.29 0.00 0.29 0.00 3.97
[root@ip-172-31-28-103 sa]# sar -d --device
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
12:58:53 AM dev202-0 0.40 0.00 5.42 13.67 0.00 0.44 0.11 0.00
12:59:08 AM dev202-0 0.07 0.00 1.13 16.00 0.00 0.00 0.00 0.00
01:00:02 AM dev202-0 0.30 0.00 4.39 14.88 0.00 0.12 0.12 0.00
01:01:42 AM dev202-0 0.29 0.00 3.81 13.21 0.00 0.34 0.10 0.00
01:10:01 AM dev202-0 0.17 0.02 2.77 15.94 0.00 0.33 0.14 0.00
Average: dev202-0 0.21 0.01 3.10 15.12 0.00 0.32 0.13 0.00
[root@ip-172-31-28-103 sa]# sar -w --Context switch
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM proc/s cswch/s
12:58:53 AM 0.31 61.01
12:59:08 AM 0.42 68.39
01:00:02 AM 0.18 61.34
01:01:42 AM 0.27 61.04
01:10:01 AM 0.06 56.94
Average: 0.12 58.25
[root@ip-172-31-28-103 sa]# sar -r --Run Queue and Load Average
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty
12:58:53 AM 130192 884784 87.17 0 671728 550932 54.28 385096 340260 20
12:59:08 AM 130120 884856 87.18 0 671732 550932 54.28 385108 340252 20
01:00:02 AM 129492 885484 87.24 0 671784 552864 54.47 385580 340248 16
01:01:42 AM 130088 884888 87.18 0 671748 550932 54.28 385120 340256 24
01:10:01 AM 127892 887084 87.40 0 671816 556896 54.87 386680 340268 28
Average: 129557 885419 87.24 0 671762 552511 54.44 385517 340257 22
[root@ip-172-31-28-103 sa]# sar -p --CPU Usage
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM CPU %user %nice %system %iowait %steal %idle
12:58:53 AM all 0.04 0.00 0.04 0.00 0.04 99.87
12:59:08 AM all 0.07 0.00 0.00 0.00 0.00 99.93
01:00:02 AM all 0.02 0.00 0.09 0.00 0.42 99.46
01:01:42 AM all 0.04 0.00 0.05 0.00 0.09 99.82
01:10:01 AM all 0.01 0.00 0.01 0.00 0.01 99.97
Average: all 0.02 0.00 0.03 0.00 0.05 99.91
[root@ip-172-31-28-103 sa]# sar -u CPU Usage
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM CPU %user %nice %system %iowait %steal %idle
12:58:53 AM all 0.04 0.00 0.04 0.00 0.04 99.87
12:59:08 AM all 0.07 0.00 0.00 0.00 0.00 99.93
01:00:02 AM all 0.02 0.00 0.09 0.00 0.42 99.46
01:01:42 AM all 0.04 0.00 0.05 0.00 0.09 99.82
01:10:01 AM all 0.01 0.00 0.01 0.00 0.01 99.97
Average: all 0.02 0.00 0.03 0.00 0.05 99.91
[root@ip-172-31-28-103 sa]# /usr/lib64/sa/sa1
[root@ip-172-31-28-103 sa]# sar
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
[root@ip-172-31-28-103 sa]# /usr/lib64/sa/sa1
[root@ip-172-31-28-103 sa]# sar
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM CPU %user %nice %system %iowait %steal %idle
12:58:53 AM all 0.04 0.00 0.04 0.00 0.04 99.87
Average: all 0.04 0.00 0.04 0.00 0.04 99.87
[root@ip-172-31-28-103 sa]# /usr/lib64/sa/sa1
[root@ip-172-31-28-103 sa]# sar
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM CPU %user %nice %system %iowait %steal %idle
12:58:53 AM all 0.04 0.00 0.04 0.00 0.04 99.87
12:59:08 AM all 0.07 0.00 0.00 0.00 0.00 99.93
Average: all 0.05 0.00 0.03 0.00 0.03 99.89
Linux 3.8.13-118.13.2.el6uek.x86_64 (rcdn9-emaas-rdb-001) 11/18/2016 _x86_64_ (120 CPU)
12:00:01 AM CPU %user %nice %system %iowait %steal %idle
12:10:01 AM all 1.86 0.00 0.75 0.02 0.00 97.37
12:20:02 AM all 2.20 0.00 0.93 0.02 0.00 96.85
12:30:01 AM all 1.96 0.00 0.79 0.02 0.00 97.23
12:40:01 AM all 1.81 0.00 0.73 0.01 0.00 97.45
12:50:01 AM all 2.52 0.00 1.10 0.02 0.00 96.36
01:00:01 AM all 1.67 0.00 0.75 0.02 0.00 97.56
01:10:01 AM all 2.23 0.00 0.85 0.02 0.00 96.90
01:20:01 AM all 1.85 0.00 0.76 0.01 0.00 97.37
01:30:01 AM all 1.81 0.00 0.73 0.02 0.00 97.44
[root@ip-172-31-28-103 sa]# sar -S --SWAP
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM kbswpfree kbswpused %swpused kbswpcad %swpcad
12:58:53 AM 0 0 0.00 0 0.00
12:59:08 AM 0 0 0.00 0 0.00
01:00:02 AM 0 0 0.00 0 0.00
01:01:42 AM 0 0 0.00 0 0.00
Average: 0 0 0.00 0 0.00
[root@ip-172-31-28-103 sa]# sar -b --I/O Details read, write, transaction, bytes read
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM tps rtps wtps bread/s bwrtn/s
12:58:53 AM 0.40 0.00 0.40 0.00 5.42
12:59:08 AM 0.07 0.00 0.07 0.00 1.13
01:00:02 AM 0.30 0.00 0.30 0.00 4.39
01:01:42 AM 0.29 0.00 0.29 0.00 3.81
Average: 0.29 0.00 0.29 0.00 3.97
[root@ip-172-31-28-103 sa]# sar -d --device
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
12:58:53 AM dev202-0 0.40 0.00 5.42 13.67 0.00 0.44 0.11 0.00
12:59:08 AM dev202-0 0.07 0.00 1.13 16.00 0.00 0.00 0.00 0.00
01:00:02 AM dev202-0 0.30 0.00 4.39 14.88 0.00 0.12 0.12 0.00
01:01:42 AM dev202-0 0.29 0.00 3.81 13.21 0.00 0.34 0.10 0.00
01:10:01 AM dev202-0 0.17 0.02 2.77 15.94 0.00 0.33 0.14 0.00
Average: dev202-0 0.21 0.01 3.10 15.12 0.00 0.32 0.13 0.00
[root@ip-172-31-28-103 sa]# sar -w --Context switch
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM proc/s cswch/s
12:58:53 AM 0.31 61.01
12:59:08 AM 0.42 68.39
01:00:02 AM 0.18 61.34
01:01:42 AM 0.27 61.04
01:10:01 AM 0.06 56.94
Average: 0.12 58.25
[root@ip-172-31-28-103 sa]# sar -r --Run Queue and Load Average
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty
12:58:53 AM 130192 884784 87.17 0 671728 550932 54.28 385096 340260 20
12:59:08 AM 130120 884856 87.18 0 671732 550932 54.28 385108 340252 20
01:00:02 AM 129492 885484 87.24 0 671784 552864 54.47 385580 340248 16
01:01:42 AM 130088 884888 87.18 0 671748 550932 54.28 385120 340256 24
01:10:01 AM 127892 887084 87.40 0 671816 556896 54.87 386680 340268 28
Average: 129557 885419 87.24 0 671762 552511 54.44 385517 340257 22
[root@ip-172-31-28-103 sa]# sar -p --CPU Usage
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM CPU %user %nice %system %iowait %steal %idle
12:58:53 AM all 0.04 0.00 0.04 0.00 0.04 99.87
12:59:08 AM all 0.07 0.00 0.00 0.00 0.00 99.93
01:00:02 AM all 0.02 0.00 0.09 0.00 0.42 99.46
01:01:42 AM all 0.04 0.00 0.05 0.00 0.09 99.82
01:10:01 AM all 0.01 0.00 0.01 0.00 0.01 99.97
Average: all 0.02 0.00 0.03 0.00 0.05 99.91
[root@ip-172-31-28-103 sa]# sar -u CPU Usage
Linux 3.10.0-514.el7.x86_64 (ip-172-31-28-103.ec2.internal) 11/27/2016 _x86_64_ (1 CPU)
12:58:31 AM CPU %user %nice %system %iowait %steal %idle
12:58:53 AM all 0.04 0.00 0.04 0.00 0.04 99.87
12:59:08 AM all 0.07 0.00 0.00 0.00 0.00 99.93
01:00:02 AM all 0.02 0.00 0.09 0.00 0.42 99.46
01:01:42 AM all 0.04 0.00 0.05 0.00 0.09 99.82
01:10:01 AM all 0.01 0.00 0.01 0.00 0.01 99.97
Average: all 0.02 0.00 0.03 0.00 0.05 99.91
No comments:
Post a Comment