NAME
sar — system activity reporter
SYNOPSIS
sar
[-ubdycwaqvmzAMPS]
[-p
psetid]
[-o
file]
t
[n]
sar
[-ubdycwaqvmAMPS]
[-p
psetid]
[-s
time]
[-e
time]
[-i
sec]
[-f
file]
DESCRIPTION
In the first form above,
sar
samples cumulative activity counters in the operating system at
n
intervals of
t
seconds.
If the
-o
option is specified, it saves the samples in
file
in binary format.
The default value of
n
is 1.
In the second form, with no sampling interval specified,
sar
extracts data from a previously recorded
file,
either the one specified by
-f
option or, by default, the standard system activity daily data file
/var/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.
Options
Subsets of data to be printed are specified by options:
- -u
Report CPU
utilization (the default); portion of time running
in one of several modes.
On a multi-processor system, if the
-M
option is used together with the
-u
option, per-CPU
utilization as well as the average CPU
utilization of all the active processors are reported.
If the
-M
option is not used, only the average CPU
utilization of all the active processors is reported.
On a multi-processor ProcessorSet (pset) configured system, if the
-P
option is used together with the
-M
and
-u
options, the column for pset mapping to processor will be displayed
before the cpu column.
- pset
pset id (only on a multi-processor pset configured system with the
-P
,
-M
and
-u
option);
- cpu
cpu number (only on a multi-processor system with the
-M
option);
- %usr
user mode;
- %sys
system mode;
- %wio
idle with some process waiting for I/O
(only block I/O, raw I/O, or VM
pageins/swapins indicated);
- %idle
otherwise idle.
- -b
Report buffer activity:
- bread/s
Number of physical reads per second from the disk
(or other block devices) to the buffer cache;
- bwrit/s
Number of physical writes per second
from the buffer cache to the disk (or other block device);
- lread/s
Number of reads per second from buffer cache;
- lwrit/s
Number of writes per second to buffer cache;
- %rcache
Buffer cache hit ratio for read requests e.g., 1 - bread/lread;
- %wcache
Buffer cache hit ratio for write requests e.g., 1 - bwrit/lwrit;
- pread/s
Number of reads per second from character device
using the
physio()
(raw I/O) mechanism;
- pwrit/s
Number of writes per second to character device
using the
physio()
(that is, raw I/O) mechanism;
mechanism.
- -d
Report activity for each block device, e.g., disk or tape drive.
One line is printed for each device that had
activity during the last interval. If no devices were
active, a blank line is printed. Each line contains the
following data:
- device
Logical name of the device and its corresponding instance.
Devices are categorized into the following device types:
disk3 - SCSI and NIO FL
disks
- %busy
Portion of time device was busy servicing a request;
- avque
Average number of requests outstanding for the device;
- r+w/s
Number of data transfers per second
(read and writes) from and to the device;
- blks/s
Number of bytes transferred (in 512-byte units) from and to the device;
- avwait
Average time (in milliseconds)
that transfer requests waited idly on queue for the device;
- avserv
Average time (in milliseconds) to service each transfer request
(includes seek, rotational latency, and data transfer times)
for the device.
- -y
Report tty device activity:
- rawch/s
Raw input characters per second;
- canch/s
Input characters per second processed by
canon();
- outch/s
Output characters per second;
- rcvin/s
Receive incoming character interrupts per second;
- xmtin/s
Transmit outgoing character interrupts per second;
- mdmin/s
Modem interrupt rate (not supported; always 0).
- -c
Report system calls:
- scall/s
Number of system calls of all types per second;
- sread/s
Number of
read()
and/or
readv()
system calls per second;
- swrit/s
Number of
write()
and/or
writev()
system calls per second;
- fork/s
Number of
fork()
and/or
vfork()
system calls per second;
- exec/s
Number of
exec()
system calls per second;
- rchar/s
Number of characters transferred by read system calls
block devices only) per second;
- wchar/s
Number of characters transferred by write system calls
(block devices only) per second.
- -w
Report system swapping and switching activity:
- swpin/s
Number of process swapins per second;
- swpot/s
Number of process swapouts per second;
- bswin/s
Number of 512-byte units transferred for swapins per second;
- bswot/s
Number of 512-byte units transferred for swapouts per second;
- pswch/s
Number of process context switches per second.
- -a
Report use of file access system routines:
- iget/s
Number of file system
iget()
calls per second;
- namei/s
Number of file system
lookuppn()
(pathname translation) calls per second;
- dirblk/s
Number of file system blocks read per second doing directory lookup.
- -q
Report average queue length while occupied,
and percent of time occupied.
On a multi-processor machine, if the
-M
option is used together with the
-q
option, the per-CPU
run queue as well as the average run queue
of all the active processors are reported.
If the
-M
option is not used,
only the average run queue information
of all the active processors is reported.
In a multi-processor pset configured system if the
-M
option is used with the option
-P
then pset column will will be displayed before
cpu column:
- pset
pset id (only on a multi-processor and pset configured system,
used with
-P
,
-M
and
-q
option)
- cpu
cpu number (only on a multi-processor system and used with the
-M
option)
- runq-sz
Average length of the run queue(s) of processes (in memory and runnable);
- %runocc
The percentage of time the run queue(s) were occupied by processes
(in memory and runnable);
- swpq-sz
Average length of the swap queue of runnable processes
(processes swapped out but ready to run). This column will
not be displayed when
-p
option is used to display a particular ProcessorSet (pset) information in a
pset configured system.
- %swpocc
The percentage of time the swap queue of runnable processes
(processes swapped out but ready to run) was occupied. This column
will not be displayed when
-p
option is used to display a particular ProcessorSet (pset) information in a
pset configured system.
- -v
Report status of text, process, inode and file tables:
- text-sz
(Not Applicable);
- proc-sz
The current-size and maximum-size of the process table;
- inod-sz
The current-size and maximum-size of the inode table (inode cache);
- file-sz
The current-size and maximum-size of the system file table;
- text-ov
(Not Applicable);
- proc-ov
The number of times the process table overflowed
(number of times the kernel could not find
any available process table entries) between sample points;
- inod-ov
The number of times the inode table (inode cache) overflowed
(number of times the kernel could not find
any available inode table entries) between sample points;
- file-ov
The number of times the system file table overflowed
(number of times the kernel could not find
any available file table entries) between sample points.
- -m
Report message and semaphore activities:
- msg/s
Number of System V
msgrcv()
calls per second;
- sema/s
Number of System V
semop()
calls per second;
- select/s
Number of System V
select()
calls per second.
This value will only be reported if the
-S
option is also
explicitly specified.
- -p
Report the specified ProcessorSet (pset) information. This option should
be used with
-u
or
-q
option.
- -S
Report the number of System V
select()
calls per second. This option is valid only if the
-m
option is specified.
- -A
Report all data.
Equivalent to
-udqbwcayvm.
- -M
Report the per-processor data on a multi-processor system when used with
-q
and/or
-u
options.
If the
-M
option is not used on a multi-processor system,
the output format of the
-u
and
-q
options is the same as the uni-processor output format
and the data reported is the average value of all the active processors.
- -P
Report ProcessorSet (pset) information, mapping to the processor
in the system or the specified pset. This option can only
be used with
-M
and
-q,
or
-M
and
-u
options. It can also be combined with
-p
option to display information for a particular pset.
If system is not pset configured it will display a
warning message.
- -z
Report Memory File System (MemFS) data.
sar
will recognize the
-z
option when HP's optional
SAR-MEMFS
product is installed on the system; it
will display the number of MemFS blocks in memory (blkcnt) and the
number of MemFS blocks in swap (swpcnt).
The number of MemFS
blocks is expressed in terms of 4 KB only.
Note that the
-z
option does not record MemFS data into a file.
However, if the
-z
and
-o
options are used together, then the data for all the options
except the MemFS option is recorded into a file.
You can then query this data.
It is also not possible to use the
-z
option with the
-f
option.
Using the
-A
option and the
-f
option together will not display the MemFS data.
However, using the
-A
option with
t
and
n
will display the MemFS data.
EXAMPLES
Watch CPU
activity evolve for 5 seconds:
Watch CPU
activity evolve for 10 minutes and save data:
If the
SAR-MEMFS
product is installed, watch MemFS activity
evolve for 10 minutes and save data; all data other than MemFS
data is stored in file
temp:
Review disk and tape activity from that period later:
Review CPU utilization on a multiprocessor system later:
WARNINGS
Users of
sar
must not rely on the exact field widths and spacing of its output,
as these will vary depending on the system, the release of HP-UX, and
the data to be displayed.
The output of
sar
is unpredictable if a corrupted or wrong data file
is given as argument with the
-f
option.
The behavior of the
sa1
and
sa2
scripts and the
sadc
command remain unaltered with the
SAR-MEMFS
product; these scripts and command do not record data reported by the
-z
option.
FILES
- /var/adm/sa/sadd
daily data file, where
dd
is two digits representing the day of the month.
STANDARDS CONFORMANCE
sar: SVID2, SVID3