|
|
/usr/bin/cpusar
-P cpu
[ -IjQu ]
[ -A ]
t
[ n ]
/usr/bin/cpusar
-P cpu
[ -IjQu ]
[ -A ]
[ -s time ]
[ -e time ]
[ -i sec ]
[ -f file ]
/usr/bin/mpsar
[ -abBcdFghILmnOpQqrRSuvwy ]
[ -A ]
[ -o file ]
t
[ n ]
/usr/bin/mpsar
[ -abBcdFghILmnOpQqrRSuvwy ]
[ -A ]
[ -s time ]
[ -e time ]
[ -i sec ]
[ -f file ]
/usr/lib/sa/sadc [ t n ] [ ofile ]
/usr/lib/sa/sadc R ofile
/usr/lib/sa/sa1 [ t [ n ] ]
/usr/lib/sa/sa2 [ -abBcdghLmnOpqrRSuvwy ] [-s time ] [-e time ] [-i sec ]
These utilities report the status of counters in the operating system that are incremented as the system performs various activities. These include counters for CPU utilization, buffer usage, disk I/O activity, TTY device activity, switching and system-call activity, file access, queue activity, inter-process communications, swapping and paging.
See ``Managing performance'' in the Performance Guide for more information about performance tuning.
cpusar reports activity for an individual CPU specified by the cpu argument to the -P option. cpu must be a number in the range from 1, the base processor, to the number of processors configured on the system. cpusar reports the data on CPU utilization, inter-CPU interrupts, and number of locked processes.
mpsar reports activity for an entire SMP system by combining the data of all the CPUs.
sar, cpusar, and mpsar sample cumulative activity counters in the operating system at n intervals of t seconds, where t should be 1 or greater. The default value of n is 1.
cpusar cannot save data. It can read a data file written by mpsar. This file contains the per-CPU data required by cpusar.
If you do not specify an input file or time interval, sar, cpusar, and mpsar read the standard system activity daily data file /usr/adm/sa/sadd for the current day of the month (dd).
You can select a section of the report file by specifying the start and end times with the -s and -e options. The time argument to these takes the form hh[:mm[:ss]]. Here hh is the hour (00-23), mm is the minute (00-59), and ss is the second (00-59). An example would be 20:30.
The -i option selects records at sec second intervals. Otherwise, all intervals found in the data file are reported.
Any information displayed as ``/s'' is a per second average over the interval t. Each of these values is calculated as the total number of occurrences of the event, over the duration of the interval t, divided by the interval t.
On SMP systems, the following options may also be used:
-F, -I, -j, -Q
See ``Tuning CPU resources'' in the Performance Guide for more information.
See ``Tuning memory resources'' in the Performance Guide for more information.
See
``Tuning I/O resources'' in the Performance Guide
for more information.
See ``Tuning system call activity'' in the Performance Guide for more information.
%usr
%sys
%wio
%idle
On a typical timesharing system, %sys
and %usr
have about the same value.
In special applications, either of these can be larger
than the other without anything being abnormal, depending on the
number of system calls that the applications mix makes.
A value of %wio
consistently greater than 15%
generally means a disk bottleneck.
If the value of %idle
is close to 0,
and the value of %sys
is high and much greater
than %usr
, the bottleneck may be caused by excessive
swapping and paging due to a memory shortage.
If the value of %idle
is consistently close to 0,
together with degraded response time for the users, this may imply
that the system is swapping or paging due to memory shortage.
%idle
is normally higher than 40% on multiuser
systems, even those with a large number of active users.
When this figure falls consistently below 30%, the
critical resource is processor power. (Run
ps(C)
to check if the excessive CPU usage is
due to a runaway process that
is stealing every spare CPU cycle.)
If you are running a large number of users, it may help to use intelligent serial cards or network terminal concentrators to take some of the burden off the CPU.
Database servers or machines running computationally intensive
processes should normally be expected to
run with a very low value of %idle
at peak usage.
In addition, examine the crontab(C) files to see which jobs can be rescheduled to run at off-peak times. Encourage users to run large, non-interactive commands at off-peak hours using batch(C). Run commands at a lower priority using nice(C), or use renice(C) to set a lower priority on existing processes.
On SMP systems, a CPU's usage is reported as ``idle'' if it has been turned off with cpuonoff(ADM).
iget/s
namei/s
dirblk/s
The larger the values reported,
the more time the kernel spends accessing user files.
This indicates how heavily programs
and applications are using the filesystem(s).
Since pathnames usually have several components,
iget/s
is always greater than namei/s
.
In general, if the ratio of iget/s
to namei/s
is consistently high,
the organization of your filesystem may be inefficient.
bread/s
lread/s
%rcache
lread/s
-bread/s
)100/lread/s
bwrit/s
lwrit/s
%wcache
lwrit/s
-bwrit/s
)100/lwrit/s
pread/s
pwrit/s
The cache hit ratios, %rcache
and %wcache
,
measure the effectiveness of system buffering.
If %rcache
and %wcache
are consistently low,
it may be possible to improve performance
by increasing the number of buffers and buffer hash queues
(by adjusting the NBUF and
NHBUF tunable parameters).
If your application is I/O-intensive
and you have a large memory configuration,
you may want to tune the buffer cache so that
the values of %rcache
and %wcache
are high.
sar should be run for the entire duration of an I/O-intensive application to establish if the size of the buffer cache is adequate.
cpybuf/s
slpcpybuf/s
Copy buffers are needed by some DMA controllers,
disk controllers, and SCSI
host adapters that cannot perform DMA to buffers that
lie above the first 16MB of memory.
If slpcpybuf/s
is consistently greater
than 0, increase the number of copy buffers (set by the
multiphysical buffer parameter NMPBUF),
increase the percentage
of buffers in the first 16MB of memory (set by
PLOWBUFS), or upgrade to controllers
that support 32-bit DMA addressing.
scall/s
sread/s
swrit/s
fork/s
exec/s
rchar/s
wchar/s
This report is of interest mostly to programmers who are testing application programs.
Typically, reads plus writes account for about half of the total
system calls, although this varies greatly with the activities
that are being performed by the system.
If scall/s
is high over an extended period of time,
or the number of characters read or written
per read or write call is low,
this may indicate inefficient application code.
Note that vmstat(C) also provides cumulative statistics about system calls executed (-s option) and number of forks (-f option).
Sdsk0
represents the first SCSI disk.
The activity data reported is:
device
%busy
avque
r+w/s
blks/s
avwait
avserv
Note that avque
and avwait
are measured
only while the queue is occupied.
If %busy
is small, large queues and service times
probably represent periodic flushes of the buffer cache to disk.
The optimum setup is to keep %busy
high
and avque
low by balancing
filesystems and swap areas across all disks, disk controllers,
and host adapters.
ovsiohw/s
ovsiodma/s
ovclist/s
If the value of ovclist/s
(and warnings on the console) shows that
the character list buffers are overflowing,
increase the value of NCLIST.
You can increase the number of clist buffers
on a temporary basis using
setconf(ADM)
to avoid having to relink and reboot the kernel immediately.
mpbuf/s
ompb/s
mphbuf/s
omphbuf/s
pbuf/s
spbuf/s
dmabuf/s
sdmabuf/s
If the value of ompb/s
or sdmabuf/s
is consistently greater than 0, increase
the value of the multiphysical buffer parameter NMPBUF.
name
sleep/s
usp-sl/s
ksp-sl/s
sp-acq
msg/s
sema/s
If you are not running application programs
that use message queues and semaphores,
these should print as 0.00.
If you are using these facilities
and the value of sema/s
is high,
the application may not be using IPC efficiently.
c_hits
cmisses
hit %
c_hits
100/(c_hits
+cmisses
).
The namei cache improves the time required to search
a full pathname when first accessing a file.
Generally, the higher the value of hit %
,
the better.
If hit %
is consistently low,
increase the values of CACHEENTS.
Note that pathname elements longer than 14 characters are not cached.
read/s
write/s
blks/s
%direct
vflt/s
pflt/s
pgfil/s
rclm/s
High values of vlft/s
can indicate that
the application programs that you are running
are not efficient for a paging system
due to poor locality of reference.
runq-sz
%runocc
swpq-sz
%swpocc
If runq-sz
is greater than 2 and
%runocc
is greater than 90%,
the CPU is heavily loaded
and response time may be degraded.
In this case, upgrading to
a more powerful CPU
or a multiprocessing configuration
might improve system response time.
If your applications perform a large number of
floating-point calculations, you should consider
adding floating-point hardware if this does not already exist
on your system.
If %swpocc
is non-zero,
your system has swapped out processes; adding
more memory, or reducing the number of buffers
may help reduce swapping and paging activity.
freemem
freeswp
The Average
statistics also display a count
of the number of samples taken.
If freemem
drops below GPGSLO at a clock
tick, the page stealer (vhand) starts adding clean
(that is, text or unchanged) or dirty (changed) pages to the free list
until freemem
is greater than GPGSHI;
it also copies dirty pages to swap. If freemem
drops
to zero between clock ticks, the swapper (sched)
becomes active and starts swapping out whole processes to disk.
Steady drops in the value of freeswp
also indicate
that the system is swapping or paging. The -l option to
swap(ADM)
shows the total size of the swap area(s) in blocks.
dptch/s
idler/s
swidle/s
reqblk/s
oreqblk/s
If oreqblk/s
is consistently greater than 0,
increase the value of SDSKOUT using
configure(ADM).
proc-sz
inod-sz
file-sz
lock-sz
ov
If set to values greater than zero, the tunables MAX_PROC, MAX_INODE, MAX_FILE, and MAX_FLCKREC determine the maximum possible size to which the process, in-core inode, file, and record lock tables may grow. The pstat(C) command provides similar information in a different format.
swpin/s
bswin/s
swpot/s
bswot/s
pswch/s
If swpot/s
is greater than zero, you may need to
increase the amount of memory or reduce the number of buffers.
Disk accesses are significantly slower than memory accesses,
so minimizing activity to swap is important for good system performance.
The -s option of
vmstat(C)
also provides information
about swapping and context-switching activity.
rawch/s
canch/s
outch/s
rcvin/s
xmtin/s
mdmin/s
Not all terminal drivers are written
to produce these statistics.
Most SCO OpenServer serial, console, and pseudo-terminal drivers
and drivers produced by third-party vendors
produce the rawch/s
, canch/s
, and
outch/s
statistics.
The ratios of rcvin/s
to rawch/s
,
rcvin/s
to canch/s
, and
xmtin/s
to outch/s
should be fairly constant.
For non-intelligent I/O cards,
these ratios should be close to 1.
Intelligent I/O drivers move
many characters per interrupt,
and some drivers do not even use interrupts,
so the ratios should be lower in these cases.
If the number of interrupts per transmitted character
starts to increase dramatically, this may indicate a bad line
generating extraneous interrupts. A faulty modem line may be
indicated if mdmin/s
is significantly greater than 0.
vector
ints/s
prfp
%prfp
prfpem
%prfpem
cpuint_snd/s
cpuint_rcv/s
IOcpuints/s
pltoCPU
%pltoCPU
sadc is a data collector. It samples system data n times, with an interval of t seconds between samples, and writes in binary format to ofile or to standard output. The sampling interval t should be greater than 5 seconds; otherwise, the activity of sadc itself may affect the sample. If t and n are omitted, a special record is written.
The R flag to sadc marks the time at which the system counters are reset to 0 when the system goes to multiuser mode. The /etc/init.d/perf file writes the restart mark to the daily data file using the command:
su sys -c "/usr/lib/sa/sadc R /usr/adm/sa/sa`date +%d`"sa1 collects and stores data in the binary file /usr/adm/sa/sadd where dd is the current day of the month. The arguments t and n cause records to be written n times at an interval of t seconds, or once if n is omitted.
sa2 writes a readable daily report
to the file /usr/adm/sa/sardd.
If system activity recording is enabled, the following entries in /usr/spool/cron/crontabs/sys (see crontab(C)) produce records every 20 minutes during working hours and hourly otherwise:
0 * * * 0-6 /usr/lib/sa/sa1 20,40 8-17 * * 1-5 /usr/lib/sa/sa1The following /usr/spool/cron/crontabs/root entry produces a readable report of all activities every 20 minutes during the working day:
5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -AThe result of running the sa1 or sa2 scripts is to make a record of the system's daily activity for the previous month in the directory /usr/adm/sa as binary files (sadd), or ASCII reports (sardd).
sar: Incompatible start and end times specified (etime <= stime)
sar: Time step and/or number of steps requested are invalid
sar: Can't open
filenamesar: ofile same as ffile
sar:
argument -- illegal argument for option
optionsar: cannot open namelist file
sar: read error in namelist file
sar: namelist not in a.out format
sar: read error in section headers
sar: .text, .data, or .bss was not found in section headers
sar: cannot allocate space for namelist
sar: error in seeking to string table
sar: read error for string table size
sar: cannot allocate space for string table
sar: read error in string table
The following diagnostic messages are specific to cpusar:
cpusar: Cannot monitor CPU
cpucpusar: This is not an SMP system
To watch CPU activity evolve for 10 minutes and save data
once per minute:
sar -o /tmp/sartmp 60 10
To review activity on block devices from that period:
sar -d -f /tmp/sartmp
To watch interrupt handler activity on the first additional
CPU of a multiprocessor system
for 10 minutes at 10 second intervals:
cpusar -P 2 -j 10 60
To watch CPU activity evolve for 10 minutes and save data:
mpsar -o /tmp/mpsartmp 60 10
To review activity on block devices from that period:
mpsar -d -f /tmp/mpsartmp
To review base CPU utilization and interrupt
activity from that period:
cpusar -P 1 -u -j -f /tmp/mpsartmp
Running multiple copies of sar can affect the results. Data collection is performed automatically by the kernel and is extracted using sar. It is the extraction process, not the collection, that consumes resources, therefore results produced when running multiple copies might not reflect the actual performance of the system.
The current version of sar is compatible with older versions of sar. Any data files saved with older versions can be read with the current version.
``Tools reference'' in the Performance Guide
cpusar and mpsar are not part of any currently supported standard; they are extensions of AT&T System V provided by The Santa Cruz Operation, Inc.