nsar(1) DG/UX R4.11MU05 nsar(1)
NAME
nsar - new system activity reporter
SYNOPSIS
nsar [-ubdycwaqvmpgrkA] [-W Onames] [-W D=dtypes] [-o file] t [n]
nsar [-ubdycwaqvmpgrkA] [-W Onames] [-W D=dtypes] [-s time] [-e time]
[-i sec] [-f file]
DESCRIPTION
The first case of nsar samples cumulative activity counters in the
operating system at n intervals of t seconds. If you specify the -o
option, nsar writes complete samples to file (in binary format) in
addition to displaying them on the screen. The default value for n
is 1.
In the second instance, with no sampling interval specified, nsar
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/nsadd 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.
-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. Only buffering of file system metadata
is reported by these statistics:
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
by the read-aheads performed by the
operating system, which are counted in the
bread value but for which there is no
corresponding count in the lread 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. 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.
-d Report activity for each disk drive. By default physical disk
data are shown, but virtual disk data may also be shown by using
the -W D= option, described below. When data is displayed, the
device specification (e.g., sd(insc(0),0,0) or vdm(root))
indicates the particular physical disk drive or virtual disk.
See admpdisk(1M) and admvdisk(1M) for more information on disk
devices.
%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).
-g Report page-out and memory freeing activities.
pgout/s page-out operations per second.
ppgout/s pages paged-out per second. This value may
be greater than the number of operations,
pgout/s, because a single operation may
page-out several pages.
pgfree/s pages freed and added to the free list per
second. This value was reported with the -p
option in earlier versions of sar as rclm/s.
pgscan/s pages scanned per second by frame purging
daemon.
-k Report kernel memory allocation activity. These values are
useful to device driver writers for finding memory leaks.
pg mem, alloc, fail pageable memory pool size, the number of
bytes allocated to requests from the kernel
for pageable memory, and the number of
requests that have failed. The memory pool
size is dynamic and will always be larger
than allocations from it.
npg mem, alloc, fail
nonpageable memory pool size, the number of
bytes allocated from it, and the number of
requests that have failed. The memory pool
size is dynamic and will always be larger
than allocations from it.
-m Report message and semaphore activities:
msg/s, sema/s msgsnd(2) and semop(2) system calls issued
per second.
-p Report paging activities:
atch/s page faults per second satisfied by
reclaiming a page already in memory (soft
faults).
pgin/s page-in requests per second.
ppgin/s pages paged-in per second.
pflt/s protection faults per second from "copy-on-
writes". This form of page fault creates a
new page table entry and copies of a page
previously shared for reading into the new
page for writing;
vflt/s address translation page faults per second
(valid page not in memory);
-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.
The sum of these percentages may not be 100%
because they are rounded.
-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 -ubdycwaqvmpgrk.
-W D=dtypes
Select the types of disks to report data for. If the -d option
or a -W O name option containing disk data is selected, that
data will be reported for all disks of the types given by dtypes
which may be -W D=p, -W D=v, -W D=v,p, -W D=p,v, or -W D=. These
indicate sampling of, respectively: physical disks, virtual
disks, both, both, and neither. When used in combination with
the -o file option, or when supplied to the data collector
nsadc(1M), the -W D= can reduce storage requirements for data
considerably when disk data is not needed.
-W Onames
Report data with the specified comma-separated list of names.
For each sample, nsar will report a line of data values for each
-W O option. See Examples below. If the names in a -W O option
argument contain a name of disk data, the line will be repeated
for each physical disk or OSM volume being sampled. See
Tailoring Nsar Output below.
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.
Tailoring Nsar Output
The nsar -W -O option can provide only the data of interest from the
standard sar options, or provide additional information. The
following table shows valid arguments to the -W O option for
statistics available through the standard sar output as described
above.
-W O name sar option sar title
iget -a iget/s
namei -a namei/s
dirblk -a dirbk/s
bread -b bread/s
lread -b lread/s
%rcache -b %rcache
bwrit -b bwrit/s
lwrit -b lwrit/s
%wcache -b %wcache
pread -b lread/s
pwrit -b lwrit/s
scall -c scall/s
sread -c sread/s
swrit -c swrit/s
fork -c fork/s
exec -c exec/s
rchar -c rchar/s
wchar -c wchar/s
%busy -d %busy
avque -d avque
r+w -d r+w/s
blks -d blks/s
avwait -d avwait
avserv -d avserv
pgout -g pgout/s
ppgout -g ppgout/s
pgfree -g pgfree/s
pgscan -g pgscan/s
pgmem -k pg mem
palloc -k alloc
pgfail -k fail
npgmem -k npg mem
npalloc -k alloc
npgfail -k fail
nsar(1) DG/UX R4.11MU05 nsar(1)
-W O options (continued):
-W O name sar option sar title
msg -m msg/s
sema -m sema/s
atch -p atch/s
pgin -p pgin/s
ppgin -p ppgin/s
pflt -p pflt/s
vflt -p vflt/s
pgfil -p pgfil/s
runq -q runq-sz
%runocc -q %runocc
swpq -q swpq-sz
%swpocc -q %swpocc
freemem -r freemem
freeswp -r freeswp
%usr -u %usr
%sys -u %sys
%idle -u %idle
procsz -v proc-sz
procov -v ov
inodsz -v inod-sz
inodov -v ov
filesz -v file-sz
fileov -v ov
locksz -v lock-sz
swpin -w swpin/s
bswin -w bswin/s
swpot -w swpot/s
bswot -w bswot/s
pswch -w pswch/s
rawch -y rawch/s
canch -y canch/s
outch -y outch/s
rcvin -y rcvin/s
xmtin -y xmtin/s
mdmin -y mdmin/s
In addition to the standard sar statistics listed above, nsar reports
separate disk read and write statistics, %swap allocated, and
statistics on memory usage and paging. The disk statistics, when
requested, are reported for each physical disk or OSM volume.
-W O name nsar title description
drblock rblks/s blocks read from the disk
drreq reads/s read requests to the disk
dwblock wblks/s blocks written to the disk
dwreq writes/s write requests to the disk
%swap %swap percentage of swap allocated
The following statistics describe the distribution of resident pages
among various memory classifications, in units of pages. Anonymous
memory is that which does not correspond to a file object and if
paged is paged to the swap area. Private mapped pages are those that
exist in the address space of a single process, while shared mapped
pages may exist in the address space of more than one process. File
pages, when paged, are paged from the file system. Data file pages
may be read and written, where as program file pages are only read
from the file system.
-W O name nsar title description
kanon-res kanon kernel anonymous pages
upanon-res upanon user private anonymous pages
usanon-res usanon user shared anonymous pages
pfile-res pfile program file pages
dfile-res dfile data file pages
The following statistics describe system paging activity, both in
terms of the number of pages affected and the number of paging
operations. The -W O name for a statistic has 3 syllables: a paging
operation type, a page type, and a units type - either operations or
pages. That is, it has the form: operation-pagetype-units.
The syllables for paging operation types are
hfault hard faults - require physical i/o
sfault soft faults - require page table manipulation but no
physical i/o
hnfault hard non-faults - require physical i/o
snfault soft non-faults - require page table manipulation
but no physical i/o
cfault copy-on-write page faults
rdirty replace dirty page - new pages made available by
writing modified or "dirty" pages to backing store
rclean replace clean page - new pages made available by
making unmodified or "clean" pages non-resident
fclean forced page clean - modified pages written to
backing store by the memcntl(2) MC_SYNC operation or
fsync(2)
uclean unforced file page clean - modified file pages
written to backing store by the file page cleaning
daemon
The syllables for page types are as described above for resident
memory statistics:
kanon kernel anonymous pages
upanon user private anonymous pages
usanon user shared anonymous pages
pfile program file pages
dfile data file pages
The syllables for specifying the units of these statistics are
op number of operations or requests
pp number of pages affected
The arguments to the -W O option for paging statistics are given by
separating the three syllables by hyphens, e.g.
-W Ohfault-pfile-op,hfault-dfile-op,hfault-upanon-op
For each sample this -W O option will print a line of the form
00:00:05 hf-pf-op/s hf-df-op/s hp-up-op/s
00:00:10 2 0 12
EXAMPLES
$ nsar 1
dgux cedar-rock 5.4R3.00 generic AViiON 07/29/93
09:14:26 %usr %sys %idle
09:14:27 7 6 85
$
By default the system activity reporter, nsar, with a single t
argument, will capture two samples, t seconds apart, and display the
CPU usage.
cedar-rock% nsar
dgux cedar-rock 5.4R3.00 generic AViiON 08/02/93
00:00:03 %usr %sys %idle
01:00:02 0 1 97
02:00:02 0 1 97
03:00:03 0 1 97
04:00:03 0 1 97
05:00:03 0 1 97
06:00:03 0 1 97
07:00:03 0 1 97
08:00:09 1 2 95
08:20:09 0 3 96
08:40:09 2 3 93
09:00:06 4 6 89
09:20:06 1 4 94
09:40:07 2 8 88
10:00:05 2 5 91
Average 0 2 96
In the example above, nsar without arguments displays CPU usage from
the standard system activity daily file for the current day. In this
case the file is /usr/adm/sa/nsa02, (see the example crontab(1) entry
in nsar(1M)). Nsar computes and displays the average of each
requested statistic.
$ nsar -c -s 9 -e 10
dgux cedar-rock 5.4R3.00 generic AViiON 08/02/93
09:00:06 scall/s sread/s swrit/s fork/s exec/s rchar/s wchar/s
09:20:06 77.2 3.5 3.1 0.1 0.0 584.1 336.9
09:40:07 108.9 13.6 7.4 0.4 0.5 6544.6 444.6
Average 143.36 7.76 5.17 0.18 0.22 2619.52 384.88
$
In the example above, the -s and -e options to nsar examine the
system call activity between 9:00 and 10:00 am from the same daily
file as the previous example.
$ nsar -gp -s 9 -e 10
dgux cedar-rock 5.4R3.00 generic AViiON 08/02/93
09:00:06 pgout/s ppgout/s pgfree/s pgscan/s
09:20:06 0.88 0.89 1.4 9.1
09:40:07 1.16 1.19 1.8 11.3
Average 1.02 1.04 1.6 10.2
09:00:06 atch/s pgin/s ppgin/s pflt/s vflt/s
09:20:06 0.00 0.66 1.07 1.1 0.6
09:40:07 0.00 0.60 0.74 8.7 0.6
Average 0.00 0.63 0.90 4.9 0.6
$
In this example, nsar reports paging activity in the interval
examined before.
$ nsar -W O%usr,%sys,%swap,pgout,pgin,vflt,sread,swrit 10 10
dgux cedar-rock 5.4R3.00 generic AViiON 08/04/93
09:14:57 %usr %sys %swap pgout/s pgin/s vflt/s sread/s swrit/s
09:15:07 6 14 56 10.88 13.92 13.9 33.8 22.1
09:15:17 32 39 57 23.24 11.27 11.3 65.9 133.7
09:15:27 63 35 57 1.19 1.00 1.0 154.7 90.7
09:15:38 49 44 58 0.60 2.99 3.0 194.6 106.6
09:15:48 34 60 58 0.20 7.87 7.9 257.5 156.1
09:15:58 51 46 58 0.20 0.10 0.1 194.4 132.9
09:16:08 63 33 58 0.00 0.30 0.0 143.8 80.9
09:16:18 66 33 58 0.00 0.30 0.3 150.7 84.6
09:16:28 57 39 58 0.40 0.00 0.0 133.2 120.9
09:16:38 58 32 58 0.00 0.10 0.1 133.8 78.6
Average 48 38 57 3.68 3.80 3.8 146.1 100.6
$
In the example above, the nsar -W O option shows a number of
statistics useful in understanding system performance in a compact
format.
To watch CPU activity evolve for 10 minutes, simultaneously saving
data to a file named temp:
nsar -o temp 60 10
To review disk activity recorded in file temp:
nsar -d -f temp
FILES
/usr/adm/sa/nsadd daily data file, where dd are digits representing
the day of the month.
/usr/lib/sa/nsadc data collection program.
NOTES
Nsar will replace sar in a future major revision of the DG/UX system.
The current sar will then be named osar and the current nsar will
then be named sar.
A sampling interval of less than 5 seconds is discouraged, for then
the activity of nsar itself may affect the sample.
Using nsar 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. Using the -W D=v option with the -f
option to report data from a log file presumes that the file has been
created using the -W D=v option to capture OSM data; otherwise OSM
data cannot be reported.
By reporting rates per second, nsar 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, nsar will report an output character rate of 20 characters
per second. If that same activity occurred within a ten-second
sample, nsar would report a rate of 2 characters per second.
The output files of sadc and nsadc are incompatible.
BUGS
If more than one reporting option is specified, and nsar is
collecting live data (as opposed to reading data from a file), the
headers are printed all together and the output may be difficult to
read.
SEE ALSO
nsar(1M), sar, sar(1M), timex, and the document Analyzing DG/UX
Performance (093-701129-00).
Licensed material--property of copyright holder(s)