[ -IjQu ]
[ -A ]
[ n ]
/usr/bin/cpusar -P cpu [ -IjQu ] [ -A ] [ -s time ] [ -e time ] [ -i sec ] [ -f file ]
[ -abBcdFghILmnOpQqrRSuvwy ]
[ -A ]
[ -o file ]
[ 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.
``Tuning I/O resources'' in the Performance Guide
for more information.
See ``Tuning system call activity'' in the Performance Guide for more information.
On a typical timesharing system,
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
%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
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).
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
In general, if the ratio of
is consistently high,
the organization of your filesystem may be inefficient.
The cache hit ratios,
measure the effectiveness of system buffering.
%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
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.
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.
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.
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.
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).
Sdsk0represents the first SCSI disk.
The activity data reported is:
avwait are measured
only while the queue is occupied.
%busy is small, large queues and service times
probably represent periodic flushes of the buffer cache to disk.
The optimum setup is to keep
avque low by balancing
filesystems and swap areas across all disks, disk controllers,
and host adapters.
If the value of
(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
to avoid having to relink and reboot the kernel immediately.
If the value of
sdmabuf/s is consistently greater than 0, increase
the value of the multiphysical buffer parameter NMPBUF.
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.
The namei cache improves the time required to search
a full pathname when first accessing a file.
Generally, the higher the value of
hit % is consistently low,
increase the values of CACHEENTS.
Note that pathname elements longer than 14 characters are not cached.
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 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.
%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.
Average statistics also display a
of the number of samples taken.
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
freemem is greater than GPGSHI;
it also copies dirty pages to swap. If
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
shows the total size of the swap area(s) in blocks.
oreqblk/s is consistently greater than 0,
increase the value of SDSKOUT using
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.
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
also provides information
about swapping and context-switching activity.
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
The ratios of
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
mdmin/s is significantly greater than 0.
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 openfilename
sar: ofile same as ffile
-- illegal argument for optionoption
sar: 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 CPUcpu
cpusar: 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.