sar usage

I like to use the linux utility sar (system activity reporter (?))

I gives a fast and quite complete overview over the performance of a linux system.
SAR has a lot of possibilitys. I just highlight a few of them to remember how the syntax is 🙂

CPU information of today

oracle@lqas4342:~$sar
Linux 4.18.0-425.13.1.el8_7.x86_64 (lqas4342.mod.nl) 04/26/2023 _x86_64_ (4 CPU)

12:00:01 AM CPU %user %nice %system %iowait %steal %idle
12:00:03 AM all 25.22 0.00 1.09 0.00 0.00 73.69
12:10:01 AM all 25.39 0.00 0.58 0.23 0.00 73.81
12:10:14 AM all 25.06 0.00 0.45 0.17 0.00 74.32
12:20:01 AM all 25.28 0.00 0.56 0.16 0.00 74.01
12:20:06 AM all 25.12 0.00 0.60 0.05 0.00 74.23
12:30:01 AM all 25.13 0.00 0.55 0.55 0.00 73.77
12:30:01 AM all 24.89 0.00 1.31 0.44 0.00 73.36
12:40:01 AM all 25.19 0.00 0.43 0.13 0.00 74.25
12:40:06 AM all 25.08 0.00 0.44 0.00 0.00 74.48
12:50:01 AM all 25.14 0.01 0.42 0.13 0.00 74.29
12:50:57 AM all 25.07 0.00 0.36 0.03 0.00 74.54
01:00:01 AM all 25.15 0.00 0.44 0.08 0.00 74.33
01:00:01 AM all 26.02 0.00 0.81 0.41 0.00 72.76
...
...

CPU information of day 24 in this month

oracle@lqas4342:~$sar -f /var/log/sa/sa24
Linux 4.18.0-425.13.1.el8_7.x86_64 (lqas4342.mod.nl) 04/24/2023 _x86_64_ (4 CPU)

12:00:01 AM CPU %user %nice %system %iowait %steal %idle
12:10:00 AM all 25.30 0.00 5.56 23.95 0.00 45.19
12:10:01 AM all 33.78 0.00 9.36 15.05 0.00 41.81
12:20:00 AM all 41.13 0.00 7.52 5.40 0.00 45.95
12:20:01 AM all 45.91 0.00 3.96 8.44 0.00 41.69
12:30:00 AM all 28.38 0.00 8.52 7.51 0.00 55.58
12:30:01 AM all 20.84 0.00 23.28 45.01 0.00 10.86
12:40:00 AM all 16.69 0.00 1.73 4.52 0.00 77.06
12:40:01 AM all 3.89 0.00 0.74 0.19 0.00 95.19
12:50:00 AM all 19.94 0.00 7.36 13.20 0.00 59.50
12:50:01 AM all 25.39 0.00 9.67 33.85 0.00 31.09
01:00:00 AM all 19.85 0.04 5.59 12.16 0.00 62.36
01:00:01 AM all 10.81 0.00 2.54 3.97 0.00 82.67
...
...

CPU information from the 24th of this month between 06:00:00 and 07:00:00
oracle@lqas4342:~$sar -f /var/log/sa/sa24 -s 06:00:00 -e 07:00:00
Linux 4.18.0-425.13.1.el8_7.x86_64 (lqas4342.mod.nl) 04/24/2023 _x86_64_ (4 CPU)

06:00:00 AM CPU %user %nice %system %iowait %steal %idle
06:00:01 AM all 17.12 0.00 9.35 22.16 0.00 51.37
06:10:00 AM all 53.08 0.00 10.88 32.53 0.00 3.51
06:10:01 AM all 59.06 0.00 13.15 24.97 0.00 2.82
06:20:00 AM all 62.68 0.00 16.42 15.40 0.00 5.50
06:20:02 AM all 73.13 0.00 26.87 0.00 0.00 0.00
06:30:00 AM all 74.44 0.00 25.56 0.00 0.00 0.00
06:30:02 AM all 72.73 0.00 27.27 0.00 0.00 0.00
06:40:00 AM all 75.66 0.00 24.34 0.00 0.00 0.00
06:40:01 AM all 85.00 0.00 15.00 0.00 0.00 0.00
06:50:00 AM all 74.93 0.02 21.55 2.70 0.00 0.81
06:50:01 AM all 56.05 0.00 30.62 12.35 0.00 0.99
07:00:00 AM all 60.06 0.00 22.33 14.32 0.00 3.29
Average: all 66.81 0.00 20.18 10.81 0.00 2.20
oracle@lqas4342:~$

Swap used on the 24th of this month between 06:00:00 and 07:00:00
oracle@lqas4342:~$sar -f /var/log/sa/sa24 -s 06:00:00 -e 07:00:00 -S
Linux 4.18.0-425.13.1.el8_7.x86_64 (lqas4342.mod.nl) 04/24/2023 _x86_64_ (4 CPU)

06:00:00 AM kbswpfree kbswpused %swpused kbswpcad %swpcad
06:00:01 AM 51331640 16821696 24.68 1166192 6.93
06:10:00 AM 52516124 15637212 22.94 2720180 17.40
06:10:01 AM 52503528 15649808 22.96 2726792 17.42
06:20:00 AM 48136600 20016736 29.37 1682284 8.40
06:20:02 AM 48132824 20020512 29.38 1670084 8.34
06:30:00 AM 46562076 21591260 31.68 629528 2.92
06:30:02 AM 46561596 21591740 31.68 630404 2.92
06:40:00 AM 45888328 22265008 32.67 1140120 5.12
06:40:01 AM 45889096 22264240 32.67 1140388 5.12
06:50:00 AM 45222132 22931204 33.65 556244 2.43
06:50:01 AM 45195144 22958192 33.69 554808 2.42
07:00:00 AM 42441544 25711792 37.73 858356 3.34
Average: 47531719 20621617 30.26 1289615 6.25
oracle@lqas4342:~$

Leave a Reply

Your email address will not be published. Required fields are marked *