Hot answers tagged

13

You're seeing the unexpected loadavg because of high iowait. 98.7 in the wa section of top shows this. From your screenshots I see the kworker process is also in uninterruptible sleep (state of D within top) which occurs when a process is waiting for disk I/O to complete. vmstat gives you visibility into the run queue. Execute vmstat 1 in typical sar ...


4

Linux, unlike most if not all other Unix like OSes, is not only counting processes using a CPU or waiting for a CPU in the run queue as a reference for its load calculation, but also add the number of processes (threads actually) being in uninterruptible state, i.e. waiting for for a disk or network I/O to complete. The latter are actually idle, i.e. not ...


4

Understanding the output of SAR command %user: This shows the total time that the processor is spending on different user processes %sys: this shows the percentage of time spend by the processor for operating system tasks(because the previous user shows the time spend for user end process) %iowait: the name iowait itself suggests that its the time spend ...


4

The output you have provided looks different from the standard sar -P ALL or sar -u output. I'm not sure if you hand formatted it, or if you're running it through another tool, but I think there's enough information there to figure this out. Here's the important piece of information, obtained from the man page for sar Note: On SMP machines a processor ...


4

This man page has a more detailed explanation of this property: runq-sz The number of kernel threads in memory that are waiting for a CPU to run. Typically, this value should be less than 2. Consistently higher values mean that the system might be CPU-bound. Interpreting results As is the case with many "indicators" you have to use them in ...


3

The numbers in the file name normally represent the data for that specific day on the month. You can extract the data from the files with: sar -f <filename> The sa files are data files that can only be read an interrogated using the sar package. The sar files are just ASCII files that can be read with something like cat.


3

If you divide the used space by the total space, you get 10485/(118401+10485) ≈ 0.08135, which sar rounds to 8.14%. By default, on an ext2/ext3/ext4 filesystem, 5% of the space is reserved to root. The “Avail” value displayed by the df command does not include this reserved space in the total space (i.e. it performs the calculation based on 95% of the total ...


3

I believe atop does what your are looking for. It logs process resource utilization at intervals of your choice, and you can go back in time to see what happened at a specific time (atop -r logfile -b time then use t and T).


3

You can't. sar gathers data and summarises it, but it can't make data up for days where it wasn't installed. sar isn't going to other tools and summarising the data those tools are collecting, sar collects it directly, live, at the time.


3

The answers in Turn off buffering in pipe provide several techniques which you can use. The principal idea is that commands which are not connected to an interactive terminal (for example, in a pipeline) are using buffering. One command which can run another command with different buffering settings is the GNU coreutils stdbuf command which you can apply to ...


3

The sa1 command collects and stores binary data in system activity data file. The command is a kind of shell wrapper of sadc command and it accepts all its parameters. So check the sadc man page for details. The first line above is correct as XALL means to collect all available system activities. The collection will run for 1 hour (10 * 360s = 3600s = 1h) ...


3

You can find the average by piping the tail command to your command. By this way, your command will always return only one line. sar -u -s 00:00:00 -e 23:59:59 -f /var/log/sysstat/sa10 | tail -1


3

You can use psutil in python and create your customized json. psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network, sensors) in Python. It is useful mainly for system monitoring, profiling, limiting process resources and the management ...


2

Here's the list of -graph options available in kSar v5.0.6 - all-cpu bond0-if1 bond0-if2 eth0-if1 eth0-if2 eth2-if1 eth2-if2 LinuxcswchSar LinuxioSar LinuxkbmemSar LinuxkbmiscSar LinuxkbswpSar LinuxloadSar LinuxnfsdSar LinuxnfsSar LinuxpageSar LinuxpgpSar LinuxprocSar LinuxsockSar LinuxswapSar lo-if1 lo-if2 Here's an example of how I generate a report - ...


2

This is just a guess but the effect is easily explained if the run queue length is not an average value (and why should it be if there are already three average values?) but a point in time. The one entry sar sees on the run queue is always sar itself. Unless you add a process in which case there are two then.


2

I think your entry is awesome. It collects over the full interval vs. 1 second I see everywhere else. Because, as I (Charles Stepp) have commented on the "10 Useful Sar (Sysstat) Examples for UNIX / Linux Performance Monitoring" article on the web site "The Geek Stuff": In the crontab entry, you should not be limiting the interval to 1 second. Sar ...


2

Personally, I'd do it this way: parse the time into epoch format. print the epoch time in the desired output format. E.g. like this: #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; use Time::Piece; while ( <DATA> ) { my ( $time_str ) = m/^([\d\:]+ [AP]M)/; print $time_str, "=>",; my $newtime = Time::Piece -> ...


2

Try this: paste <(sar -r) <(sar -u) <(sar -q) <(sar -S) > sar.out A sample output: 12:00:01 AM kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit 12:00:01 AM CPU %user %nice %system %iowait %steal %idle 12:00:01 AM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 12:10:01 AM 1737724 6311336 ...


2

The Net-SNMP package supplied with RedHat is actually a very flexible monitoring agent, which will get values for all of the metrics you listed by default out of the box. However, it's old: the SNMP protocol itself has been around for over two decades, with significant improvements made over that span. The learning curve for it is fairly steep, as well. ...


2

No. Unless you have set some (complex) monitoring you won't be able to find out which process used CPU once process has exited. there is no such "standard" thing as a table with exec path;exec name;stime,etime,%sys,%io,%wait,%idle,... you must catch the process during exec time.


1

Allow me to reveal the small Linux secret: there is no reliable iowait statistics in Linux. This is only truth. From PROC(5) we read: iowait (since Linux 2.5.41) (5) Time waiting for I/O to complete. This value is not reliable, for the following reasons: The CPU will not wait for I/O to complete; iowait is the time that a task is waiting ...


1

You can try with join to collect all the data in a single file: join <(join <(sar -q) <(sar -S)) <(join <(sar -u) <(sar -r))


1

Run . /etc/sysstat/sysstat within your script. That will result in environment variable $SA_DIR being set appropriately.


1

The 09th SAR file refers to the day of the month the SAR file was created. The header is created by sar's data collector (sadc). When sar runs and finds a file there, it appends to it, unless (1) it cannot recognize the file format (version change) (2) the date is older, in which case it overwrites the file. So what probably has happened is that sadc was ...


1

There is a fork that seems to be maintained. The latest commit was a month ago. Real features are getting added. https://github.com/vlsi/ksar


1

There is Performance Co-Pilot (pcp), which is included in RHEL. It can visualize sar data. It's not quite as straightforward as ksar, but it is more capable.


1

Using a recent sysstat version (eg. 11.4.0), it is now possible to draw graphs using the sadf command that comes along with sar. sadf can export data collected by sar in SVG (Scalable Vector Graphics) using its switch "-g". Read more at http://sebastien.godard.pagesperso-orange.fr/


1

Unlike other metrics (eg. CPU utilization) which are calculated over a time interval, the values displayed by "sar -r" (among them is %commit) are instantaneous values, based on values read from /proc/meminfo file. So %commit includes data that are in the page cache at the end of the given time period the entry covers.


1

try sar -P ALL 1 1 | awk 'NF == 9 && $3 != "all" {cpu=$3; pctUser=$4; pctNice=$5; pctSystem=$6; pctIowait=$7; pctIdle=$NF ; printf "%-3s %9s %9s %9s %9s %9s\n", cpu, pctUser, pctNice, pctSystem, pctIowait, pctIdle}' NF == 9 you need to filter on nine filed (NF) $3 != "all" skip the line that summarize cpus no caracter but end-of-line after ...


1

On most linux distros (if not all), sar already saves that data in a file in /var/log.... Have look at -o in man sar to find the exact path: -o [ filename ] Save the readings in the file in binary form. Each reading is in a separate record. The default value of the filename parameter is the current daily data file, the /var/log/...


Only top voted, non community-wiki answers of a minimum length are eligible