Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

4 votes
1 answers
2202 views
Why 7z not using enough CPU?
CentOS 9. 3 vCPU VM with 4Gb RAM. I run a cron job with 7z compressing 35Gb data in 150 files `7za a -mx=9 -mmt=3 ...` RAM usage - 18%, disk queue is very small, CPU is 61% on average. Why not 100% ? How do I find the bottleneck? ``` sar -p -d 1 10 Linux 5.14.0-80.el9.x86_64 (logger) 30/04/22 _x86_6...
CentOS 9. 3 vCPU VM with 4Gb RAM. I run a cron job with 7z compressing 35Gb data in 150 files 7za a -mx=9 -mmt=3 ... RAM usage - 18%, disk queue is very small, CPU is 61% on average. Why not 100% ? How do I find the bottleneck?
sar -p -d 1 10
Linux 5.14.0-80.el9.x86_64 (logger)       30/04/22        _x86_64_        (3 CPU)

16:50:10          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:11         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:11          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:12         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:12          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:13        39.00  33832.00      0.00      0.00    867.49      0.04      0.95      1.90 sda

16:50:13          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:14         2.00      0.00     24.00      0.00     12.00      0.00      0.50      0.10 sda

16:50:14          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:15         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:15          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:16         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:16          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:17         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:17          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:18         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

16:50:18          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:19         2.00      0.00     12.00      0.00      6.00      0.00      0.50      0.20 sda

16:50:19          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
16:50:20         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 sda

Average:          tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util DEV
Average:         4.30   3383.20      3.60      0.00    787.63      0.00      0.91      0.22 sda
sar -p -u 1 10
Linux 5.14.0-80.el9.x86_64 (logger)       30/04/22        _x86_64_        (3 CPU)

16:50:26        CPU     %user     %nice   %system   %iowait    %steal     %idle
16:50:27        all     60.20      0.00      0.99      0.00      0.00     38.82
16:50:28        all     61.54      0.00      0.67      0.00      0.00     37.79
16:50:29        all     60.87      0.00      0.33      0.00      0.00     38.80
16:50:30        all     59.26      0.00      1.01      0.00      0.00     39.73
16:50:31        all     60.20      0.00      1.00      0.00      0.00     38.80
16:50:32        all     62.79      0.00      0.00      0.00      0.00     37.21
16:50:33        all     63.46      0.00      1.00      0.00      0.00     35.55
16:50:34        all     64.88      0.00      0.67      0.00      0.00     34.45
16:50:35        all     63.04      0.00      0.66      0.00      0.00     36.30
16:50:36        all     62.88      0.00      0.33      0.00      0.00     36.79
Average:        all     61.91      0.00      0.67      0.00      0.00     37.42
**EDIT** I found this doc: https://documentation.help/7-Zip/method.htm and it says "LZMA compression uses only 2 threads." which would explain what I observe on CentOS. But on Windows it uses 24 threads with LZMA.. Why?
Boppity Bop (169 rep)
Apr 30, 2022, 05:01 PM • Last activity: Jun 4, 2025, 07:03 AM
0 votes
1 answers
2808 views
pidstat %CPU vs htop %CPU of a process
I'm using the pidstat to monitor the cpu usage of a process and it shows 100%. For the same process the htop or top shows 200% for the same process. The system has 16 cores, and the process i am monitoring was set to use only two cores. So the htop or top reported %CPU is correct. I also changed the...
I'm using the pidstat to monitor the cpu usage of a process and it shows 100%. For the same process the htop or top shows 200% for the same process. The system has 16 cores, and the process i am monitoring was set to use only two cores. So the htop or top reported %CPU is correct. I also changed the process to use only one core and in that case also pidstat shows 100% cpu and htop shows 100% Is pidstat measures the %CPU differently?
Madan (101 rep)
Jun 5, 2020, 04:01 AM • Last activity: May 26, 2025, 05:02 AM
1 votes
1 answers
214 views
What exactly does %wait in pidstat mean?
Environment Ubuntu22.04 sysstat version 12.2.0 Number of logical CPUs 16 man pidstat shows the following, but I would like to know more specifically about the denominator and numerator of %wait. > Percentage of CPU spent by the task while waiting to run. One time I was looking at the performance of...
Environment Ubuntu22.04 sysstat version 12.2.0 Number of logical CPUs 16 man pidstat shows the following, but I would like to know more specifically about the denominator and numerator of %wait. > Percentage of CPU spent by the task while waiting to run. One time I was looking at the performance of each process in pidstat and found that there were times when the %wait of one process was quite high, such as 90%. At the same time, %usr was also high and sometimes exceeded 100%. At that time, the total CPU utilization was close to 100%, and the total %CPU of all processes was close to 1600%, which is the number of CPU cores. However, the total %wait of all processes was more than 1000%. Since CPU resources are used only for %CPU, I assume that %wait is the time when CPU is not used, but what is this percentage? In mpstat, for example, the total of %usr, %sys, %iowait, %idle, etc. would be about 100% of CPU resources. What exactly is the %wait in the case of pidstat? If the process is simply not running, I think %wait would also be 0. It is also curious that during the times when %wait was high, disk i/o and net i/o were not high when examined by dstat and other means. From reading the systat code, it seems that %wait, like %usr and %sys, uses as its numerator the cumulative increase in the amount of time that corresponds to wait at a given point in time, and as its denominator the period of time compared to that point in time. I am not sure what kind of time can be considered as %wait.
LAPK (11 rep)
Jan 15, 2025, 11:13 PM • Last activity: Jan 16, 2025, 12:15 AM
2 votes
1 answers
1547 views
Enable sysstat temperature logging
I'm trying to enable sysstat to take temperature readings, so that I have past temperature information to diagnose host failures in the future. I tried this command to get temperature information: ``` $ sar -m TEMP Requested activities not available in file /var/log/sysstat/sa22 ``` Here's what the...
I'm trying to enable sysstat to take temperature readings, so that I have past temperature information to diagnose host failures in the future. I tried this command to get temperature information:
$ sar -m TEMP
Requested activities not available in file /var/log/sysstat/sa22
Here's what the sar man page has to say about this:
-m { keyword [,...] | ALL }
       Report power management statistics.  Note that these statistics depend on sadc's option "-S  POWER"  to
       be collected.

       Possible keywords are CPU, FAN, FREQ, IN, TEMP and USB.

       [...]

       With  the  TEMP  keyword,  statistics about devices temperature are reported.  The following values are
       displayed:
According to this, power management information (which temperature is a subset of) is not logged by default. So, I changed the file /etc/sysstat/sysstat to enable it. I changed this:
# Parameters for the system activity data collector (see sadc(8) manual page)
# which are used for the generation of log files.
# By default contains the `-S DISK' option responsible for generating disk
# statisitcs. Use `-S XALL' to collect all available statistics.
SADC_OPTIONS="-S DISK"
into this:
SADC_OPTIONS="-S DISK,POWER"
Another issue on the [sysstat issue tracker](https://github.com/sysstat/sysstat/issues/156) said that sysstat requires lm-sensors to function, so I installed that package too. Here's the output of sensors:
$ sensors
acpitz-acpi-0
Adapter: ACPI interface
temp1:        +27.8°C  (crit = +119.0°C)
temp2:        +29.8°C  (crit = +119.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +89.0°C  (high = +82.0°C, crit = +100.0°C)
Core 0:        +86.0°C  (high = +82.0°C, crit = +100.0°C)
Core 1:        +88.0°C  (high = +82.0°C, crit = +100.0°C)
Core 2:        +89.0°C  (high = +82.0°C, crit = +100.0°C)
Core 3:        +89.0°C  (high = +82.0°C, crit = +100.0°C)
Core 4:        +88.0°C  (high = +82.0°C, crit = +100.0°C)
Core 5:        +87.0°C  (high = +82.0°C, crit = +100.0°C)

nvme-pci-0800
Adapter: PCI adapter
Composite:    +38.9°C  (low  = -273.1°C, high = +84.8°C)
                       (crit = +84.8°C)
Sensor 1:     +38.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +37.9°C  (low  = -273.1°C, high = +65261.8°C)
So this does seem to correctly detect my temperature sensors. I also tried waiting ten minutes for another collection to happen. (My system is configured to log every ten minutes, at :05, :15, :25, etc.) Unfortunately, after all that, I still get the same error:
$ sar -m TEMP
Requested activities not available in file /var/log/sysstat/sa22
Nick ODell (2798 rep)
Mar 22, 2022, 09:35 PM • Last activity: Aug 7, 2024, 03:23 PM
0 votes
1 answers
295 views
Can I use SAR to log GPU usage metrics?
`sar` is a great tool to log various resource usage metrics, regarding CPU, memory, I/O, network... ...but not GPU? I won't be remotely original by stressing the importance of logging GPU usage metrics (load, temperature, etc.) for some of us. Is there a way to have `sar` aware of those probes and l...
sar is a great tool to log various resource usage metrics, regarding CPU, memory, I/O, network... ...but not GPU? I won't be remotely original by stressing the importance of logging GPU usage metrics (load, temperature, etc.) for some of us. Is there a way to have sar aware of those probes and log their values along the other metrics?
user209974 (121 rep)
Jun 29, 2023, 03:37 PM • Last activity: Jun 29, 2023, 03:56 PM
0 votes
2 answers
2067 views
In iostat, why are kB_wrtn/s and kB_wrtn the same?
/dev/sdc is a SATA hard drive. Do the kB_read and kB_wrtn fields sometimes, in some situations, show total counts? Here it seems to be just the same as the per second value. - Linux kernel 5.4.0-26-generic. - sysstat version 12.2.0 `iostat -dz 1` ``` Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read...
/dev/sdc is a SATA hard drive. Do the kB_read and kB_wrtn fields sometimes, in some situations, show total counts? Here it seems to be just the same as the per second value. - Linux kernel 5.4.0-26-generic. - sysstat version 12.2.0 iostat -dz 1
Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
sdc              40.00         0.00        21.00         0.00          0         21          0


Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
dm-0              6.00         0.00        24.00         0.00          0         24          0
sdc              42.00         0.00        42.50         0.00          0         42          0


Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
dm-0              5.00         0.00        20.00         0.00          0         20          0
sdc              43.00         0.00        36.00         0.00          0         36          0


Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
sdc              48.00         0.00        25.00         0.00          0         25          0


Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
sdc              36.00         0.00        18.50         0.00          0         18          0


Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
sdc              40.00         0.00        21.00         0.00          0         21          0
brendan (195 rep)
Mar 28, 2021, 12:08 PM • Last activity: Mar 27, 2023, 01:12 PM
0 votes
1 answers
250 views
RHEL 6 sa and sar log file size
I am trying to figure out why sa and sar log files are much larger on one of our servers. Basically double the size -rw-r--r-- 1 root root 100M Feb 5 23:59 sa05 -rw-r--r-- 1 root root 100M Feb 6 23:59 sa06 -rw-r--r-- 1 root root 100M Feb 7 23:59 sa07 -rw-r--r-- 1 root root 141M Feb 5 23:53 sar05 -rw...
I am trying to figure out why sa and sar log files are much larger on one of our servers. Basically double the size -rw-r--r-- 1 root root 100M Feb 5 23:59 sa05 -rw-r--r-- 1 root root 100M Feb 6 23:59 sa06 -rw-r--r-- 1 root root 100M Feb 7 23:59 sa07 -rw-r--r-- 1 root root 141M Feb 5 23:53 sar05 -rw-r--r-- 1 root root 141M Feb 6 23:53 sar06 -rw-r--r-- 1 root root 141M Feb 7 23:53 sar07 compare to another server -rw-r--r-- 1 root root 34M Feb 5 23:59 sa05 -rw-r--r-- 1 root root 34M Feb 6 23:59 sa06 -rw-r--r-- 1 root root 34M Feb 7 23:59 sa07 -rw-r--r-- 1 root root 57M Feb 5 23:53 sar05 -rw-r--r-- 1 root root 57M Feb 6 23:53 sar06 -rw-r--r-- 1 root root 57M Feb 7 23:53 sar07 Anyone sees this before and any idea to reduce sa/sar log size?
Ask and Learn (1895 rep)
Mar 1, 2022, 03:17 AM • Last activity: Jan 27, 2023, 03:56 PM
10 votes
3 answers
14393 views
Can I avoid debian-sa1 lines in my syslog?
My syslog is chock-full of the following: ``` Oct 28 23:35:01 myhost CRON[17705]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) Oct 28 23:45:01 myhost CRON[18392]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) ``` and also some ``` Oct 28 23:59:01 myhost CRON[19...
My syslog is chock-full of the following:
Oct 28 23:35:01 myhost CRON: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 28 23:45:01 myhost CRON: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
and also some
Oct 28 23:59:01 myhost CRON: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 60 2)
Now, obviously, these come from cron jobs, in /etc/cron.d/sysstat:
# Activity reports every 10 minutes everyday
5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1

# Additional run at 23:59 to rotate the statistics file
59 23 * * * root command -v debian-sa1 > /dev/null && debian-sa1 60 2
Do I need to have this run so frequently? It doesn't seem to do much when I run it manually. Can I/should I just turn off the cron job, or uninstall sysstat?
einpoklum (10753 rep)
Oct 28, 2019, 10:48 PM • Last activity: Nov 16, 2022, 08:14 AM
0 votes
1 answers
226 views
SAR / syssstat issues
I am having issues with SAR not populating daily logs from the 10 minute interval runs it is supposed to be doing. I have the same configuration on multiple servers, and they are running sar just fine. Here is an example of the setup: -CentOS 6 -sysstat 9.0.4 ```# cat /etc/sysconfig/sysstat # syssta...
I am having issues with SAR not populating daily logs from the 10 minute interval runs it is supposed to be doing. I have the same configuration on multiple servers, and they are running sar just fine. Here is an example of the setup: -CentOS 6 -sysstat 9.0.4
# cat /etc/sysconfig/sysstat
# sysstat-9.0.4 configuration file.
# How long to keep log files (in days).
# If value is greater than 28, then log files are kept in
# multiple directories, one for each month.
HISTORY=28
# Compress (using gzip or bzip2) sa and sar files older than (in days):
COMPRESSAFTER=31
# Parameters for the system activity data collector (see sadc manual page)
# which are used for the generation of log files.
SADC_OPTIONS="-S DISK"
# Compression program to use.
ZIP="bzip2"


# cat /etc/crond./sysstat
# Run system activity accounting tool every 10 minutes
*/5 * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A
This is the output of files from a working server, as it should look:
-rw-r--r-- 1 root root 714305 Aug  1 23:53 sar01
-rw-r--r-- 1 root root 784968 Aug  1 23:55 sa01
-rw-r--r-- 1 root root 703111 Aug  2 23:53 sar02
-rw-r--r-- 1 root root 785016 Aug  2 23:55 sa02
-rw-r--r-- 1 root root 685031 Aug  3 23:53 sar03
-rw-r--r-- 1 root root 761928 Aug  3 23:55 sa03
-rw-r--r-- 1 root root 711740 Aug  4 22:20 sa04
This is the output from the problem server (these files are also miniscule with no info):
-rw-r--r-- 1 root root 552 Dec  7  2020 sa07
-rw-r--r-- 1 root root 504 Dec 21  2020 sa21
-rw-r--r-- 1 root root 504 Oct 20  2021 sa20
-rw-r--r-- 1 root root 504 Jul 14 21:11 sa14
-rw-r--r-- 1 root root 504 Jul 26 20:53 sa26
-rw-r--r-- 1 root root 504 Aug  4 22:04 sa04
I have also tried stopping/starting sysstat and killing the pid for /usr/local/netsnmp/netsnmp_base/sbin/snmpd. Nothing seems to be working. Any help would be greatly apprecaited!
Dylan Michaels (1 rep)
Aug 5, 2022, 05:32 AM • Last activity: Aug 12, 2022, 05:32 AM
0 votes
1 answers
1147 views
Sysstat Time Options and Command Differences
I would like to track total CPU and memory use on an Ubuntu 20.04 machine. For that purpose, I am about to install the sysstat library. I read the manuals of and posts on `sar` and related functions, but am still confused about the syntax. **What I would like to do**: Record total CPU and memory use...
I would like to track total CPU and memory use on an Ubuntu 20.04 machine. For that purpose, I am about to install the sysstat library. I read the manuals of and posts on sar and related functions, but am still confused about the syntax. **What I would like to do**: Record total CPU and memory use every five seconds. Export the data once a day as CSV and delete the binary data. **What confuses me**: 1. There are multiple settings specifying time intervals. sar -u %system -r %memused 5 records CPU and memory use every five seconds. On top of that, the package generates "activity reports" every ten minutes as defined by 5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1 in /etc/cron.d/sysstat. I am confused about what happens every five seconds and what happens every ten minutes. Does the program first cache the data every five seconds and then writes it to a file every ten minutes? 2. Multiple functions write to disk. Which of them do I need? sar -u %system -r %memused -o 5, sadc -u %system -r %memused 5 -, or sa1? 3. Do I need to execute the code that generates a daily CSV file (sadf -d /var/log/sysstat/sa$(date +%d -d yesterday) > /home/some_user/sar_data.csv) as a chron job? As a side note: if anyone knows of a solution that would be computationally more efficient than this sysstat approach, feel free to suggest it.
user (71 rep)
Jul 18, 2021, 12:04 PM • Last activity: Jul 18, 2021, 04:17 PM
0 votes
1 answers
216 views
How should I run sysstat / sar to get a reading for 00:00:00 in same day data file
I was trying the below entries to get the sar information for every 5 minutes including the 00:00:00 (midnight) data. 0 * * * * root /usr/lib64/sa/sa1 300 6 */5 1-22 * * * root /usr/lib64/sa/sa1 1 1 0,5,10,15,20,25,30,35,40,45,50,55 23 * * * root /usr/lib64/sa/sa1 1 1 55 23 * * * root /usr/lib64/sa/...
I was trying the below entries to get the sar information for every 5 minutes including the 00:00:00 (midnight) data. 0 * * * * root /usr/lib64/sa/sa1 300 6 */5 1-22 * * * root /usr/lib64/sa/sa1 1 1 0,5,10,15,20,25,30,35,40,45,50,55 23 * * * root /usr/lib64/sa/sa1 1 1 55 23 * * * root /usr/lib64/sa/sa1 300 2 5,10,15,20,25,30,35,40,45,50,55 0 * * * root /usr/lib64/sa/sa1 1 1 But the above command adds the midnight data at end of the previous daily data file. I want to get the reading of 00:00:00 midnight entry in the same day file.
whiterose (1089 rep)
May 20, 2021, 06:14 AM • Last activity: May 20, 2021, 07:17 AM
1 votes
0 answers
387 views
Monitoring the activity of tape drive with SCSI generic driver (sg)
I would like to monitor statistics (transfer rate, byte/sec) for each LTO tape drive connected to Linux system. I understand that tapestat command can exactly do this, but this shows the activity of tape driver: /dev/st only. In other words, if we write/read data using SCSI generic driver: /dev/sg ,...
I would like to monitor statistics (transfer rate, byte/sec) for each LTO tape drive connected to Linux system. I understand that tapestat command can exactly do this, but this shows the activity of tape driver:/dev/st only. In other words, if we write/read data using SCSI generic driver: /dev/sg, this command shows nothing. Indeed, when reading/writing data with ITDT from IBM that uses the generic driver, I can not see any statistics. Is there any good ways to monitor transfer rate even with SCSI generic driver?
Kevin Nakamoto (146 rep)
Apr 29, 2021, 12:09 AM • Last activity: Apr 29, 2021, 12:21 AM
1 votes
1 answers
1055 views
sysstat sar only collects cpu usage
I'm running into a problem when using `sar` to collect live system statistics. When I run a sar command such as the following, I get the right output: $ sar -r 1 -o /tmp/memory_usage Linux 4.15.0-70-generic () 29/12/20 _x86_64_ (60 CPU) 18:26:55 kbmemfree kbavail kbmemused %memused kbbuffers kbcache...
I'm running into a problem when using sar to collect live system statistics. When I run a sar command such as the following, I get the right output: $ sar -r 1 -o /tmp/memory_usage Linux 4.15.0-70-generic () 29/12/20 _x86_64_ (60 CPU) 18:26:55 kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 18:26:56 30855140 78554416 51599624 62.58 321400 48906356 3491612 4.18 25558204 23859156 36 18:26:57 30855124 78554456 51599640 62.58 321400 48906392 3491612 4.18 25558204 23859212 72 18:26:58 30855204 78554536 51599560 62.58 321400 48906424 3491612 4.18 25558204 23859212 104 18:26:59 30855188 78554576 51599576 62.58 321400 48906456 3491612 4.18 25558204 23859268 136 18:27:00 30855204 78554648 51599560 62.58 321400 48906492 3491612 4.18 25558204 23859324 172 18:27:01 30855048 78554492 51599716 62.58 321400 48906524 3491612 4.18 25558228 23859324 0 ^C Average: 30855151 78554521 51599613 62.58 321400 48906441 3491612 4.18 25558208 23859249 87 However, when I load the output file, it seems to have only recorded the cpu usage? $ sar -f /tmp/memory_usage Linux 4.15.0-70-generic () 29/12/20 _x86_64_ (60 CPU) 18:26:55 CPU %user %nice %system %iowait %steal %idle 18:26:56 all 0.00 0.00 0.02 0.00 0.02 99.97 18:26:57 all 0.00 0.00 0.02 0.00 0.02 99.97 18:26:58 all 0.00 0.00 0.02 0.00 0.02 99.97 18:26:59 all 0.00 0.00 0.02 0.00 0.02 99.97 18:27:00 all 0.00 0.00 0.00 0.00 0.00 100.00 18:27:01 all 0.02 0.00 0.02 0.00 0.02 99.95 Average: all 0.00 0.00 0.01 0.00 0.01 99.97 This is my system's info: $ uname -a Linux 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux I'm running sar 11.6.1, which was installed through apt, and I did not configure any cron data collection (if that matters), although I did enable the sysstat service: $ systemctl status sysstat ● sysstat.service - Resets System Activity Data Collector Loaded: loaded (/lib/systemd/system/sysstat.service; enabled; vendor preset: enabled) Active: active (exited) since Tue 2020-12-29 16:56:29 GMT; 1h 34min ago Docs: man:sa1(8) man:sadc(8) man:sar(1) Process: 52376 ExecStart=/usr/lib/sysstat/debian-sa1 --boot (code=exited, status=0/SUCCESS) Main PID: 52376 (code=exited, status=0/SUCCESS) Dec 29 16:56:29 systemd: Starting Resets System Activity Data Collector... Dec 29 16:56:29 systemd: Started Resets System Activity Data Collector. Any idea what I'm doing wrong? Why is the memory usage not being recorded in the file? Did I misconfigure something, or is this not possible to achieve with sar? Any and all help would be greatly appreciated.
Dash83 (183 rep)
Dec 29, 2020, 06:34 PM • Last activity: Dec 29, 2020, 07:57 PM
2 votes
3 answers
3121 views
How to retrieve specific cpu, memory and interface statistics only
There is requirement to collect only specific stats like %idle, memfree, available, pmemused etc. I further have to convert the output to a json string and consume it. Is there any UNIX tool which can do the same? I tried sar and sadf in combination, but I am getting a complex json format which I do...
There is requirement to collect only specific stats like %idle, memfree, available, pmemused etc. I further have to convert the output to a json string and consume it. Is there any UNIX tool which can do the same? I tried sar and sadf in combination, but I am getting a complex json format which I don't require. /usr/bin/sar -r 1 1 -o tmp1 &> 1; /usr/bin/sadf tmp1 -j --iface=eth1 -- -u -r -n DEV I get this output: { "sysstat": { "hosts": [{ "nodename": "ESDNAS1", "sysname": "Linux", "release": "4.4.143-94.47-default", "machine": "x86_64", "number-of-cpus": 8, "file-date": "2019-08-02", "file-utc-time": "04:53:09", "statistics": [{ "timestamp": { "date": "2019-08-02", "time": "04:53:10", "utc": 1, "interval": 1 }, "cpu-load": [{ "cpu": "all", "user": 0.25, "nice": 0.00, "system": 1.00, "iowait": 0.00, "steal": 0.00, "idle": 98.75 }], "memory": { "memfree": 3707764, "avail": 12451860, "memused": 12013448, "memused-percent": 45.01, "buffers": 225176, "cached": 4361204, "commit": 28665304, "commit-percent": 107.41, "active": 13473076, "inactive": 1535816, "dirty": 616 }, "network": { "net-dev": [{ "iface": "eth1", "rxpck": 1.00, "txpck": 1.00, "rxkB": 0.11, "txkB": 0.00, "rxcmp": 0.00, "txcmp": 0.00, "rxmcst": 0.00, "ifutil-percent": 0.00 }] } }], "restarts": [] }] } } I am looking for something like this (or close one which is simple): { "sysstat": { "hosts": [ { "nodename": "HOSTNAME", "statistics": [ { "timestamp": { "date": "2019-08-02", "time": "04:53:10" }, "cpu-load": [ { "idle": 98.75 } ], "memory": { "memfree": 3707764, "avail": 12451860, "memused-percent": 45.01 }, "network": { "net-dev": [ { "iface": "eth1", "rxpck": 1, "txpck": 1, "ifutil-percent": 0 } ] } } ], "restarts": [] } ] } }
Aditya369 (133 rep)
Aug 2, 2019, 07:33 AM • Last activity: Aug 4, 2019, 02:43 PM
3 votes
1 answers
1968 views
Send sar series to grafana
[`sar`][1] of `sysstat` package produces a lot of useful information about system usage regarding various resources; My question (since after a brief query I was unable to find a useful suggestion / solution) is whether it is possible to send these statistics to a plotting tool, __preferably__ `graf...
sar of sysstat package produces a lot of useful information about system usage regarding various resources; My question (since after a brief query I was unable to find a useful suggestion / solution) is whether it is possible to send these statistics to a plotting tool, __preferably__ grafana.
pkaramol (3109 rep)
Nov 12, 2018, 02:46 PM • Last activity: Nov 12, 2018, 04:01 PM
1 votes
1 answers
1386 views
how to query sar(sysstat) for more than one day data points
1. I don't see 'sar' command accepts date-and-time as starttime(-s) or endtime(-e) than just time. So, how to query 'sar' for more than one day's data point with older date and times(-f not going to help here). The output of the 'sar' command should have date value too as well for the data points -...
1. I don't see 'sar' command accepts date-and-time as starttime(-s) or endtime(-e) than just time. So, how to query 'sar' for more than one day's data point with older date and times(-f not going to help here). The output of the 'sar' command should have date value too as well for the data points - instead of just time in hours and minutes. 2. I see sysstat splitting pa data files per day-wise. Is it ok to modify the default sysstat cron entries to collect sysstat(sa1/sa2) data in a single pa file per week. sysstat config: cat /etc/sysconfig/sysstat # sysstat-9.0.4 configuration file. # How long to keep log files (in days). # If value is greater than 28, then log files are kept in # multiple directories, one for each month. HISTORY=7 # Compress (using gzip or bzip2) sa and sar files older than (in days): COMPRESSAFTER=10 # Parameters for the system activity data collector (see sadc manual page) # which are used for the generation of log files. SADC_OPTIONS="-S DISK" sysstat cron entries: cat /etc/cron.d/sysstat # Run system activity accounting tool every 10 minutes */10 * * * * root /usr/lib64/sa/sa1 1 1 # 0 * * * * root /usr/lib64/sa/sa1 600 6 & # Generate a daily summary of process accounting at 23:53 53 23 * * * root /usr/lib64/sa/sa2 -A
Murali Mopuru (63 rep)
Feb 20, 2018, 06:52 AM • Last activity: Feb 28, 2018, 08:30 PM
1 votes
1 answers
2993 views
How to put systat/sar in cron on SLES 12?
Before, there was a https://linuxmain.blogspot.de/2011/12/gathering-performance-data-with-sysstat.html For SLES you can install the cron settings by SLES10: /etc/init.d/sysstat start SLES11: /etc/init.d/boot.sysstat start SLES12: systemctl start sysstat but on SLES12 it doesn't installs the cronjob...
Before, there was a https://linuxmain.blogspot.de/2011/12/gathering-performance-data-with-sysstat.html For SLES you can install the cron settings by SLES10: /etc/init.d/sysstat start SLES11: /etc/init.d/boot.sysstat start SLES12: systemctl start sysstat but on SLES12 it doesn't installs the cronjob for sar if we run the start. Q: How to install the cronjob for sar? Or it need to be done by hand?
Peter (531 rep)
May 9, 2017, 08:22 AM • Last activity: May 9, 2017, 01:46 PM
2 votes
1 answers
9796 views
Any tool for viewing historical process resource utilization? (IE: A combination of sar and pidstat)
I'm trying to troubleshoot some CPU spikes that occur every so often on a Linux server. I can use ***`sar`*** to see the resource utilization in the past, and ***`pidstat`*** to see what processes are using what resources, but `pidstat` doesn't go into the past. So what I'm looking for is a combinat...
I'm trying to troubleshoot some CPU spikes that occur every so often on a Linux server. I can use ***sar*** to see the resource utilization in the past, and ***pidstat*** to see what processes are using what resources, but pidstat doesn't go into the past. So what I'm looking for is a combination of both - Something that I can use to see what processes were taking up what resources. I haven't been able to find anything, and I know I can write a simple bash script to save the output of pidstat to a file, but if there's already a solution for this (which I would be surprised if there isn't), then I'd rather not re-invent the wheel. Thanks!
Justin (535 rep)
Mar 28, 2017, 04:33 PM • Last activity: Mar 28, 2017, 05:07 PM
1 votes
3 answers
1447 views
sun solaris 11.2 sysstat
I've sun solaris 11.2 and I want to install and use sysstat and use it the way I use it on linux-ubuntu to monitor some activities and run cpu and memory checks for certain time intervals. I was looking in the internet i couldn't find sysstat for solaris, so could you please help me how to install o...
I've sun solaris 11.2 and I want to install and use sysstat and use it the way I use it on linux-ubuntu to monitor some activities and run cpu and memory checks for certain time intervals. I was looking in the internet i couldn't find sysstat for solaris, so could you please help me how to install on solaris if exists if not, is there any other simple command or utility that I can use to monitor the cpu and memory. Thanks in advance.
Mr. Curious (71 rep)
Mar 23, 2017, 09:31 AM • Last activity: Mar 23, 2017, 08:47 PM
1 votes
2 answers
6106 views
Is this sar/sysstat cron job formatted correctly?
I want it to give me all the sar/sadc options, interrupts,disk,etc.. every 10 seconds starting at noon for the entire hour. On the second line I want to capture the info in /proc/interrupts every minute for the hour of noon in a log file. Please verify the syntax. * 12 * * * root /usr/lib64/sa/sa1 -...
I want it to give me all the sar/sadc options, interrupts,disk,etc.. every 10 seconds starting at noon for the entire hour. On the second line I want to capture the info in /proc/interrupts every minute for the hour of noon in a log file. Please verify the syntax. * 12 * * * root /usr/lib64/sa/sa1 -S XALL 10 360 */1 12 * * * root cat /proc/interrupts >> /root/proc_int.log && date >> /root/proc_int.log
Gregg Leventhal (7786 rep)
Dec 22, 2013, 03:42 PM • Last activity: Jan 5, 2017, 12:50 PM
Showing page 1 of 20 total questions