NAME

sar - system activity reporter


SYNOPSIS

sar [ -abcdmnquwyAMV ] { [ -o file ] t [ n ] | -i file }


DESCRIPTION

sar samples cumulative activity counters in /proc filesystem at n intervals of t seconds.

The default value of n is 1.

This program is written to looks like HP-UX(tm) sar. And is tested with Linux 1.3.3, 1.3.21, 1.3.47, 2.0.19, 2.1.7 2.2.12 and 2.4.2 kernels.


OPTIONS

-a
File access operations.

iget/s
namei/s
dirbk/s
-b
Shows buffers activity.

bread/s
Number of physical reads per second from the disks (or other block devices) to the buffer cache;

lread/s
Number of reads per second from buffer cache (logical reads);

%rcache
Buffer cache hit ratio for read requests e.g., bread/lread;

bwrit/s
Number of physical writes per second from the buffer cache to the disks (or other block devices);

lwrit/s
Number of writes per second to buffer cache;

%wcache
Buffer cache hit ratio for write requests e.g., bwrit/lwrit;

pread/s
Number of reads per second from character device;

pwrit/s
Number of writes per second to character device;

Note: I think that pread/s and pwrit/s values can be removed.

-c
System calls.

scall/s
Number of system calls of all types per second;

sread/s
Number of read (2) and/or readv (2) system calls per second;

swrit/s
Number of write (2) and/or writev (2) system calls per second;

fork/s
Number of fork (2) and/or vfork (2) system calls per second;

exec/s
Number of exec (2) 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.

-d
Disk devices activity.

device
Logical name of the device and its corresponding instance.

%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.

Note: In kernel versions 1.3.21 and oldest these values aren't monitored by sadc program. In kernels 1.3.47 and newest, program is able obtains informations only about IDE hard discs not about floppies and SCSI devices. In kernels 2.4 are these values available, but not yet incorporated into lkmi library, which is a source for performance data.

-m
System V message queues and semaphores.

This is not impelemnted now.

msg/s
Message queue primitives per second.

sema/s
Semaphore primitives per second.

-n
Network devices activity.

R pkts
Number of received packets per second on the network device;

X pkts
Number of transmitted packets per second on the network device;

R errs
Number of received bad packets per second on the network device (Received errors);

X errs
Number of transmitted bad packets per second on the network device (Transmitted errors);

X colls
Number of detected collisions per second on the network device;

-q
run queue size

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);

%swpocc
The percentage of time the swap queue of runnable processes (processes swapped out but ready to run) was occupied.

-u
CPU utilization in several states.

Note: If no is option used, this is default report.

%usr Percentage of time which CPU spent in user mode;
%nice
Percentage of time which CPU spent in nice mode (user mode with low priority);

%sys
Percentage of time which CPU spent in system (kernel) mode;

%idle
Percentage of time which CPU spent in idle, CPU waits for some process which is ready to run;

-w
shows swap activity

swpin/s
Number of process swap-ins per second;

bswin/s
Number of 512-byte units transferred for swap-ins per second;

swpot/s
Number of process swap-outs per second;

bswot/s
Number of 512-byte units transferred for swap-outs per second;

pswch/s
Number of process context switches per second.

-y
Terminal devices activity.

rawch/s
Raw input characters per second;

canch/s
Canonical input characters per second (inherited from HP-UX look);

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.

-A
Same as -abcdquwyM switches

Note: This feature isn't implemented yet.

-M
Shows memory and swap usage.

space
Describes which space has a numbers memory or swap space.

total
Total amount of memory or swap.

used
Used space.

free
Unused space.

shared
Shared memory space. Only for memory and pre 2.4 kernels not for swap.

buffers
Amount of memory which is used for file caching.

-V
Prints a version information, like this:

sar: ``Version: 0.50.0 (Jan 29 1998)''

-o filename
Output data to binary file. This option is be used for creating data file for later evaluation.

-f filename
Input data from binary file and show it. Input file must be created via sar using -o option or using sa1 command.

Warning: you can't use -f and -o switches simultaneously.


KNOWN BUGS

This sar/sadc may be unstable. If is system very load (busy) you can get some unusable data (wait interval between samples goes to zero), if you use short sampling interval.

Sometimes may program hangs itself.


BUGS REPORTING

Report bugs to linux_monitor(at)volny(dot)cz .

Please use subject: bug report and related form, which is available at: Bug Report

Or in source distribution ./web/bug_rep.html.


COPYRIGHT

This function is wroted as part of system activity utilities for Linux system and may be freely distributed under GPL terms.

Copyright (c) 1995, 2001 David Doubrava (e-mail: linux_monitor(at)volny(dot)cz ).


SEE ALSO

Origin of values description is in Linux kernel source.

sa1, sadc, sar