sar(1) DG/UX R4.11 sar(1)
NAME
sar - report system activity
SYNOPSIS
sar [-ubdycwaqvmprA] [-o file] t [n]
sar [-ubdycwaqvmprA] [-s time] [-e time] [-i sec] [-f file]
DESCRIPTION
The first form of sar (system activity reporter) samples cumulative
activity counters in the operating system at n intervals of t
seconds. If you specify the -o option, sar writes complete samples
to file (in binary format) in addition to displaying them on the
screen. The default value for n is 1.
The second form of sar, with no sampling interval specified, extracts
data from a previously recorded file, either the one specified by the
-f option or, by default, the standard system activity daily data
file /usr/adm/sa/sadd for the current day dd.
The starting and ending times of the report can be bounded via the -s
and -e time arguments of the form hh[:mm[:ss]]. The -i option selects
records at sec second intervals. Otherwise, all intervals found in
the data file are reported.
In either case, subsets of data to be printed are specified by the
following options. Column headings that end in "/s" indicate an
average rate per second over the interval (see NOTES, below). The
default reporting option is -u if no others are specified.
Options
-a Report use of file access system routines:
iget/s number of inode entry searches per second
(local files only);
namei/s number of pathname searches per second;
dirblk/s number of reads per second associated with
buffering a portion of a directory file
(local files only).
-b Report buffer activity:
bread/s, bwrit/s average transfers per second of data between
system buffers and disk or other block
devices;
lread/s, lwrit/s average accesses per second of system
buffers;
%rcache read cache hit ratio, i.e., the fraction of
the number of logical reads which were found
in the buffer cache (100% minus the ratio of
bread/s to lread/s). This number is skewed
due to the read-aheads performed by the
operating system, which are counted in the
bread value;
%wcache write cache hit ratio, i.e., the fraction of
the number of logical writes which were
found in the buffer cache (100% minus the
ratio of bwrit/s to lwrit/s); This number
may be skewed by cache cleaning writes which
are counted in the bwrit value and it may
even be negative when these writes are
performed.
pread/s, pwrit/s average operations per second via raw
(physical) device mechanism.
-c Report system calls:
scall/s system calls per second of all types;
sread/s, swrit/s, fork/s, exec/s
specific system calls per second;
rchar/s, wchar/s characters transferred per second by read
and write system calls (see NOTES, below).
-d Report activity for each disk drive. When data is displayed,
the device specification (e.g., sd(insc(0),0,0)) represents a
physical disk drive.
%busy portion of time device was busy servicing a
transfer request;
avque average number of requests outstanding and
being serviced during that time (measured
only when the disk is busy);
r+w/s, blks/s number of data transfers per second from or
to devices, and number of 512-byte blocks
transferred per second;
avwait average time in milliseconds that a transfer
request waits idly on the queue;
avserv average time in milliseconds for a transfer
request to be completed (which for disks
includes seek rotational latency and data
transfer times).
-m Report message and semaphore activities:
msg/s, sema/s msgsnd(2) and semop(2) system calls issued
per second.
-p Report paging activities:
vflt/s address translation page faults per second
(valid page not in memory);
pflt/s page faults per second from protection
errors (illegal access to page) or "copy-on-
writes";
pgfil/s page faults per second satisfied by reading
pages from program files;
rclm/s valid pages reclaimed per second for the
free list.
-q Report average queue length while occupied, and percentage of
time occupied:
runq-sz number of bound and runnable processes;
swpq-sz number of unbound runnable processes (the
smaller this number, the better);
%runocc, %swpocc instantaneous snapshots of whether the queue
is occupied or not, 0% indicates not
occupied, 100% indicates occupied.
-r Report unused memory pages and disk blocks:
freemem the number of pages available to user
processes (see getpagesize(2));
freeswp the number of 512-byte blocks of anonymous
memory, which includes swap space, not yet
allocated. This number is computed from the
difference between total anonymous pages,
which includes pages on a swap device and
main memory, and reserved anonymous pages.
Requests to allocate more swap space will
fail if they attempt to allocate more than
this number indicates is available.
-u Report CPU usage.
%usr, %sys, %idle portion of CPU time running in user mode,
running in system mode, and otherwise idle.
-v Report status of text, process, inode and file tables:
proc-sz, inod-sz, file-sz, lock-sz
the number of entries used/allocated for the
process table, the inode table, the file
table, and the shared memory record table,
evaluated once at the sampling point.
Entries in the inode table, file table, and
shared memory record table are allocated
dynamically, so the number of entries in use
is the same as the number of entries
allocated;
ov overflows occurring between sampling points.
-w Report swapping and switching activity:
swpin/s the number of kernel resources bound per
second. A process must have bound kernel
resources in order to run. The kernel will
bind resources for a process only if there
are no available bound kernel resources for
it to use. The kernel maintains a cache of
bound resources to minimize the need to do a
bind for each new process created via a
fork(2);
bswin/s the number of page faults per second
associated with user address space;
swpot/s the number of kernel resources unbound per
second. Kernel resources are unbound when
the system becomes overcommitted to limit
the number of processes that can run. When
a process does an exit(2), its kernel
resources will be cached for use by a new
process provided the cache is not full;
bswot/s the number of pages that belonged to bound
processes reclaimed per second;
pswch/s process switches per second.
-y Report TTY device activity:
rawch/s, canch/s, outch/s
raw mode input character rate, input
character rate processed by canon (see
termio(7) and tty(7)), and output character
rate;
rcvin/s, xmtin/s, mdmin/s
receive, transmit and modem interrupt rates.
-A Report all data. This supersedes all other options and is
equivalent to -udqbwcayvmpr.
Restart entries, indicated by
dgux restarts
in the output, mark times when the system was rebooted (or the run
level changed) and system activity counters reset to zero.
EXAMPLES
$ sar
dgux sys23 5.4R3.00 generic AViiON 08/24/93
00:00:05 %usr %sys %idle
01:00:04 3 2 95
02:00:04 3 2 94
03:00:04 3 2 96
04:00:04 3 2 96
05:00:03 3 2 96
06:00:04 3 2 96
07:00:04 3 2 96
Average 3 2 95
$
sar, displays cumulative activity statistics. In the above example,
sar reports CPU usage from the standard system activity daily file
for the current day.
$ sar -c
dgux sys23 5.4R3.00 generic AViiON 08/24/93
00:00:05 scall/s sread/s swrit/s fork/s exec/s rchar/s wchar/s
01:00:04 4 0 0 0.1 0.0 0 0
02:00:04 4 0 0 0.0 0.0 0 0
03:00:04 3 0 0 0.1 0.0 0 0
04:00:04 3 0 0 0.1 0.0 0 0
05:00:03 3 0 0 0.1 0.0 0 0
06:00:04 3 0 0 0.1 0.0 0 0
07:00:04 3 0 0 0.1 0.0 0 0
Average 3 0 0 0.1 0.0 0 0
$
In this example, sar reports system call usage from the standard
system activity daily file for the current day.
$ sar -q
dgux sys23 5.4R3.00 generic AViiON 08/24/93
00:00:05 runq-sz %runocc swpq-sz %swpocc
01:00:04 1.0 100 1.0 100
02:00:04 1.0 100 1.0 100
03:00:04 1.0 100 1.0 100
04:00:04 1.0 100 1.0 100
05:00:03 1.0 100 1.0 100
06:00:04 1.0 100 1.0 100
07:00:04 1.0 100 1.0 100
Average 1.0 100 1.0 100
$
In this example, sar reports average queue length while occupied, and
whether the queue is occupied or not at the time of the sample.
$ sar -v
dgux sys23 5.4R3.00 generic AViiON 08/24/93
00:00:05 proc-sz ov inod-sz ov file-sz ov lock-sz
01:00:04 69/256 0 240/240 0 102/102 0 0/ 0
02:00:04 69/256 0 240/240 0 102/102 0 0/ 0
03:00:04 69/256 0 242/242 0 102/102 0 0/ 0
04:00:04 69/256 0 240/240 0 102/102 0 0/ 0
05:00:03 69/256 0 240/240 0 102/102 0 0/ 0
06:00:04 69/256 0 240/240 0 102/102 0 0/ 0
07:00:04 69/256 0 240/240 0 102/102 0 0/ 0
$
In this example, sar reports on the process, inode, file, and shared
memory lock tables: the size of each table and overflows occurring
between sampling points.
To watch CPU activity evolve for 10 minutes, simultaneously saving
data to a file named temp:
sar -o temp 60 10
To review disk activity recorded in file temp:
sar -d -f temp
FILES
/usr/adm/sa/sadd daily data file, where dd are digits representing
the day of the month.
/usr/lib/sa/sadc data collection program.
SEE ALSO
sar(1M), nsar(1), nsar(1M).
NOTES
Sampling Interval
A sampling interval of less than 5 seconds is discouraged, for then
the activity of sar itself may affect the sample.
Using sar with no sampling interval, causing it to read from a named
file or the default daily file, presumes that something has been done
to collect data in that file. Otherwise, only the restart entries
will be displayed.
By reporting rates per second, sar smooths bursts of extreme activity
and inactivity. For example, if a burst of 20 characters of output
occurs within a one-second sample on an otherwise idle machine, sar
will report an output character rate of 20 characters per second. If
that same activity occurred within a ten-second sample, sar would
report a rate of 2 characters per second.
sar may show inaccurate values in the wchar/s and rchar/s columns
because the data used to calculate these values can be quite large
and may overflow ("wrap-around"). The larger the sample time, the
more likely these values are to be inaccurate.
New sar
A new version of sar, nsar is available for reporting additional
information. In a future major revision of DG/UX nsar will be named
sar and the current sar will be named osar.
Bug
If more than one reporting option is specified, the headers are
printed all together and the output may be difficult to read.
Limitations
Sar cannot be used to report from data files collected on systems
that are not running the DG/UX System. The versions of sar and sadc
prior to DG/UX Release 4.30 are incompatible with later releases.
Licensed material--property of copyright holder(s)