Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
Copyright 1989 AT&T
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
sar [-aAbcdgkmpqruvwy] [-o filename] t [n]
sar [-aAbcdgkmpqruvwy] [-e time] [-f filename] [-i sec] [-s time]
In the first instance, the sar utility samples cumulative activity counters in the operating system at n intervals of t seconds, where t should be 5 or greater. If t is specified with more than one option, all headers are printed together and the output can be difficult to read. (If the sampling interval is less than 5, the activity of sar itself can affect the sample.) If the -o option is specified, it saves the samples in filename in binary format. The default value of n is 1.
In the second instance, no sampling interval is specified. sar extracts data from a previously recorded filename, either the one specified by the -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 using the -e and -s arguments with time specified in the form hh[:mm[:ss]]. The -i option selects records at sec second intervals. Otherwise, all intervals found in the data file are reported.
The following options modify the subsets of information reported by sar. -a
Reports use of file access system routines: iget/s, namei/s, dirblk/s
Reports all data. Equivalent to -abcdgkmpqruvwy.
Reports buffer activity: bread/s, bwrit/s
transfers per second of data between system buffers and disk or other block devices.
accesses of system buffers.
transfers using raw (physical) device mechanism.
Reports system calls: scall/s
system calls of all types.
specific system calls.
characters transferred by read and write system calls. No incoming or outgoing exec(2) and fork(2) calls are reported.
Reports activity for each block device (for example, disk or tape drive) with the exception of XDC disks and tape drives. When data is displayed, the device specification dsk- is generally used to represent a disk drive. The device specification used to represent a tape drive is machine dependent. The activity data reported is: %busy, avque
portion of time device was busy servicing a transfer request, average number of requests outstanding during that time.
average wait time in milliseconds.
average service time in milliseconds.
Selects data up to time. Default is 18:00.
Reports paging activities: pgout/s
page-out requests per second.
pages paged-out per second.
pages per second placed on the free list by the page stealing daemon.
pages per second scanned by the page stealing daemon.
the percentage of UFS inodes taken off the freelist by iget which had reusable pages associated with them. These pages are flushed and cannot be reclaimed by processes. Thus, this is the percentage of igets with page flushes.
Selects data at intervals as close as possible to sec seconds.
Reports kernel memory allocation (KMA) activities: sml_mem, alloc, fail
information about the memory pool reserving and allocating space for small requests: the amount of memory in bytes KMA has for the small pool, the number of bytes allocated to satisfy requests for small amounts of memory, and the number of requests for small amounts of memory that were not satisfied (failed).
information for the large memory pool (analogous to the information for the small memory pool).
the amount of memory allocated for oversize requests and the number of oversize requests which could not be satisfied (because oversized memory is allocated dynamically, there is not a pool).
Reports message and semaphore activities: msg/s, sema/s
primitives per second.
Saves samples in file, filename, in binary format.
Reports paging activities: atch/s
page faults per second that are satisfied by reclaiming a page currently in memory (attaches per second).
page-in requests per second.
pages paged-in per second.
page faults from protection errors per second (illegal access to page) or "copy-on-writes".
address translation page faults per second (valid page not in memory).
faults per second caused by software lock requests requiring physical I/O.
Reports average queue length while occupied, and percent of time occupied: runq-sz, %runocc
Run queue of kernel threads in memory and runnable
Swap queue of processes
Reports unused memory pages and disk blocks: freemem
average pages available to user processes.
disk blocks available for page swapping.
Selects data later than time in the form hh[:mm]. Default is 08:00.
Reports CPU utilization (the default): %usr, %sys, %wio, %idle
portion of time running in user mode, running in system mode, idle with some process waiting for block I/O, and otherwise idle.
Reports status of process, i-node, file tables: proc-sz, inod-sz, file-sz, lock-sz
ovoverflows that occur between sampling points for each table.
Reports system swapping and switching activity: swpin/s, swpot/s, bswin/s, bswot/s
number of transfers and number of 512-byte units transferred for swapins and swapouts (including initial loading of some programs).
process switches.
Reports TTY device activity: rawch/s, canch/s, outch/s
input character rate, input character rate processed by canon, output character rate.
receive, transmit and modem interrupt rates.
Example 1 Viewing System Activity
The following example displays today's CPU activity so far:
example% sar
Example 2 Watching System Activity Evolve
To watch CPU activity evolve for 10 minutes and save data:
example% sar -o temp 60 10
Example 3 Reviewing Disk and Tape Activity
To later review disk and tape activity from that period:
example% sar -d -f temp
daily data file, where dd are digits representing the day of the month
iostat(1M), sar(1M), vmstat(1M), exec(2), fork(2), attributes(5)
System Administration Guide: Advanced Administration
The sum of CPU utilization might vary slightly from 100 because of rounding errors in the production of a percentage figure.