table of contents
other versions
- wheezy 10.0.5-1
- jessie 11.0.1-1
- testing 11.4.3-2
- unstable 11.4.3-2
- experimental 11.5.6-1
SAR(1) | Linux User's Manual | SAR(1) |
NAME¶
sar - Collect, report, or save system activity information.SYNOPSIS¶
sar [ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -H ] [ -i interval ] [ -p ] [ -q ] [ -r ] [ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ] [ -m { keyword [,...] | ALL } ] [ -n { keyword [,...] | ALL } ] [ -I { int [,...] | SUM | ALL | XALL } ] [ -P { cpu [,...] | ALL } ] [ -o [ filename ] | -f [ filename ] ] [ -s [ hh:mm:ss ] ] [ -e [ hh:mm:ss ] ] [ interval [ count ] ]DESCRIPTION¶
The sar command writes to standard output the contents of selected cumulative activity counters in the operating system. The accounting system, based on the values in the count and interval parameters, writes information the specified number of times spaced at the specified intervals in seconds. If the interval parameter is set to zero, the sar command displays the average statistics for the time since the system was started. If the interval parameter is specified without the count parameter, then reports are generated continuously. The collected data can also be saved in the file specified by the -o filename flag, in addition to being displayed onto the screen. If filename is omitted, sar uses the standard system activity daily data file, the /var/log/sysstat/sadd file, where the dd parameter indicates the current day. By default all the data available from the kernel are saved in the data file.OPTIONS¶
- -A
- This is equivalent to specifying -bBdHqrRSuvwWy -I SUM -I XALL -m ALL -n ALL -u ALL -P ALL.
- -b
- Report I/O and transfer rate statistics. The following
values are displayed:
Total number of transfers per second that were
issued to physical devices. A transfer is an I/O request to a physical device.
Multiple logical requests can be combined into a single I/O request to the
device. A transfer is of indeterminate size.
Total number of read requests per second
issued to physical devices.
Total number of write requests per second
issued to physical devices.
Total amount of data read from the devices in
blocks per second. Blocks are equivalent to sectors and therefore have a size
of 512 bytes.
Total amount of data written to devices in
blocks per second.
- -B
- Report paging statistics. The following values are
displayed:
Total number of kilobytes the system paged in
from disk per second.
Total number of kilobytes the system paged out
to disk per second.
Number of page faults (major + minor) made by
the system per second. This is not a count of page faults that generate I/O,
because some page faults can be resolved without I/O.
Number of major faults the system has made per
second, those which have required loading a memory page from disk.
Number of pages placed on the free list by the
system per second.
Number of pages scanned by the kswapd daemon
per second.
Number of pages scanned directly per
second.
Number of pages the system has reclaimed from
cache (pagecache and swapcache) per second to satisfy its memory
demands.
Calculated as pgsteal / pgscan, this is a
metric of the efficiency of page reclaim. If it is near 100% then almost every
page coming off the tail of the inactive list is being reaped. If it gets too
low (e.g. less than 30%) then the virtual memory is having some difficulty.
This field is displayed as zero if no pages have been scanned during the
interval of time.
- -C
- When reading data from a file, tell sar to display comments that have been inserted by sadc.
- -d
- Report activity for each block device. When data are
displayed, the device specification dev m-n is generally used (
DEV column). m is the major number of the device and
n its minor number. Device names may also be pretty-printed if
option -p is used (see below). Note that disk activity depends on sadc
options "-S DISK" and "-S XDISK" to be collected. The
following values are displayed:
Indicate the number of transfers per second
that were issued to the device. Multiple logical requests can be combined into
a single I/O request to the device. A transfer is of indeterminate size.
Number of sectors read from the device. The
size of a sector is 512 bytes.
Number of sectors written to the device. The
size of a sector is 512 bytes.
The average size (in sectors) of the requests
that were issued to the device.
The average queue length of the requests that
were issued to the device.
The average time (in milliseconds) for I/O
requests issued to the device to be served. This includes the time spent by
the requests in queue and the time spent servicing them.
The average service time (in milliseconds) for
I/O requests that were issued to the device. Warning! Do not trust this field
any more. This field will be removed in a future sysstat version.
Percentage of CPU time during which I/O
requests were issued to the device (bandwidth utilization for the device).
Device saturation occurs when this value is close to 100%.
- -e [ hh:mm:ss ]
- Set the ending time of the report. The default ending time is 18:00:00. Hours must be given in 24-hour format. This option can be used when data are read from or written to a file (options -f or -o ).
- -f [ filename ]
- Extract records from filename (created by the -o filename flag). The default value of the filename parameter is the current daily data file, the /var/log/sysstat/sadd file. The -f option is exclusive of the -o option.
- -h
- Display a short help message then exit.
- -H
- Report hugepages utilization statistics. The following
values are displayed:
Amount of hugepages memory in kilobytes that
is not yet allocated.
Amount of hugepages memory in kilobytes that
has been allocated.
Percentage of total hugepages memory that has
been allocated.
- -i interval
- Select data records at seconds as close as possible to the number specified by the interval parameter.
- -I { int [,...] | SUM | ALL | XALL }
- Report statistics for a given interrupt. int is the interrupt number. Specifying multiple -I int parameters on the command line will look at multiple independent interrupts. The SUM keyword indicates that the total number of interrupts received per second is to be displayed. The ALL keyword indicates that statistics from the first 16 interrupts are to be reported, whereas the XALL keyword indicates that statistics from all interrupts, including potential APIC interrupt sources, are to be reported. Note that interrupt statistics depend on sadc option "-S INT" to be collected.
- -m { keyword [,...] | ALL }
- Report power management statistics. Note that these
statistics depend on sadc option "-S POWER" to be collected.
Instantaneous CPU clock frequency in
MHz.
Fan speed expressed in revolutions per
minute.
This field is calculated as the difference
between current fan speed (rpm) and its low limit (fan_min).
Sensor device name.
Weighted average CPU clock frequency in MHz.
Note that the cpufreq-stats driver must be compiled in the kernel for this
option to work.
Voltage input expressed in Volts.
Relative input value. A value of 100% means
that voltage input has reached its high limit (in_max) whereas a value of 0%
means that it has reached its low limit (in_min).
Sensor device name.
Device temperature expressed in degrees
Celsius.
Relative device temperature. A value of 100%
means that temperature has reached its high limit (temp_max).
Sensor device name.
Root hub number of the USB device.
Vendor ID number (assigned by USB
organization).
Product ID number (assigned by
Manufacturer).
Maximum power consumption of the device
(expressed in mA).
Manufacturer name.
Product name.
- -n { keyword [,...] | ALL }
- Report network statistics.
Name of the network interface for which
statistics are reported.
Total number of packets received per
second.
Total number of packets transmitted per
second.
Total number of kilobytes received per
second.
Total number of kilobytes transmitted per
second.
Number of compressed packets received per
second (for cslip etc.).
Number of compressed packets transmitted per
second.
Number of multicast packets received per
second.
Name of the network interface for which
statistics are reported.
Total number of bad packets received per
second.
Total number of errors that happened per
second while transmitting packets.
Number of collisions that happened per second
while transmitting packets.
Number of received packets dropped per second
because of a lack of space in linux buffers.
Number of transmitted packets dropped per
second because of a lack of space in linux buffers.
Number of carrier-errors that happened per
second while transmitting packets.
Number of frame alignment errors that happened
per second on received packets.
Number of FIFO overrun errors that happened
per second on received packets.
Number of FIFO overrun errors that happened
per second on transmitted packets.
Number of RPC requests made per second.
Number of RPC requests per second, those which
needed to be retransmitted (for example because of a server timeout).
Number of 'read' RPC calls made per
second.
Number of 'write' RPC calls made per
second.
Number of 'access' RPC calls made per
second.
Number of 'getattr' RPC calls made per
second.
Number of RPC requests received per
second.
Number of bad RPC requests received per
second, those whose processing generated an error.
Number of network packets received per
second.
Number of UDP packets received per
second.
Number of TCP packets received per
second.
Number of reply cache hits per second.
Number of reply cache misses per second.
Number of 'read' RPC calls received per
second.
Number of 'write' RPC calls received per
second.
Number of 'access' RPC calls received per
second.
Number of 'getattr' RPC calls received per
second.
Total number of sockets used by the
system.
Number of TCP sockets currently in use.
Number of UDP sockets currently in use.
Number of RAW sockets currently in use.
Number of IP fragments currently in
queue.
Number of TCP sockets in TIME_WAIT
state.
The total number of input datagrams received
from interfaces per second, including those received in error
[ipInReceives].
The number of input datagrams per second, for
which this entity was not their final IP destination, as a result of which an
attempt was made to find a route to forward them to that final destination
[ipForwDatagrams].
The total number of input datagrams
successfully delivered per second to IP user-protocols (including ICMP)
[ipInDelivers].
The total number of IP datagrams which local
IP user-protocols (including ICMP) supplied per second to IP in requests for
transmission [ipOutRequests]. Note that this counter does not include any
datagrams counted in fwddgm/s.
The number of IP fragments received per second
which needed to be reassembled at this entity [ipReasmReqds].
The number of IP datagrams successfully
re-assembled per second [ipReasmOKs].
The number of IP datagrams that have been
successfully fragmented at this entity per second [ipFragOKs].
The number of IP datagram fragments that have
been generated per second as a result of fragmentation at this entity
[ipFragCreates].
The number of input datagrams discarded per
second due to errors in their IP headers, including bad checksums, version
number mismatch, other format errors, time-to-live exceeded, errors discovered
in processing their IP options, etc. [ipInHdrErrors]
The number of input datagrams discarded per
second because the IP address in their IP header's destination field was not a
valid address to be received at this entity. This count includes invalid
addresses (e.g., 0.0.0.0) and addresses of unsupported Classes (e.g., Class
E). For entities which are not IP routers and therefore do not forward
datagrams, this counter includes datagrams discarded because the destination
address was not a local address [ipInAddrErrors].
The number of locally-addressed datagrams
received successfully but discarded per second because of an unknown or
unsupported protocol [ipInUnknownProtos].
The number of input IP datagrams per second
for which no problems were encountered to prevent their continued processing,
but which were discarded (e.g., for lack of buffer space) [ipInDiscards]. Note
that this counter does not include any datagrams discarded while awaiting
re-assembly.
The number of output IP datagrams per second
for which no problem was encountered to prevent their transmission to their
destination, but which were discarded (e.g., for lack of buffer space)
[ipOutDiscards]. Note that this counter would include datagrams counted in
fwddgm/s if any such packets met this (discretionary) discard criterion.
The number of IP datagrams discarded per
second because no route could be found to transmit them to their destination
[ipOutNoRoutes]. Note that this counter includes any packets counted in
fwddgm/s which meet this 'no-route' criterion. Note that this includes any
datagrams which a host cannot route because all of its default routers are
down.
The number of failures detected per second by
the IP re-assembly algorithm (for whatever reason: timed out, errors, etc)
[ipReasmFails]. Note that this is not necessarily a count of discarded IP
fragments since some algorithms can lose track of the number of fragments by
combining them as they are received.
The number of IP datagrams that have been
discarded per second because they needed to be fragmented at this entity but
could not be, e.g., because their Don't Fragment flag was set
[ipFragFails].
The total number of ICMP messages which the
entity received per second [icmpInMsgs]. Note that this counter includes all
those counted by ierr/s.
The total number of ICMP messages which this
entity attempted to send per second [icmpOutMsgs]. Note that this counter
includes all those counted by oerr/s.
The number of ICMP Echo (request) messages
received per second [icmpInEchos].
The number of ICMP Echo Reply messages
received per second [icmpInEchoReps].
The number of ICMP Echo (request) messages
sent per second [icmpOutEchos].
The number of ICMP Echo Reply messages sent
per second [icmpOutEchoReps].
The number of ICMP Timestamp (request)
messages received per second [icmpInTimestamps].
The number of ICMP Timestamp Reply messages
received per second [icmpInTimestampReps].
The number of ICMP Timestamp (request)
messages sent per second [icmpOutTimestamps].
The number of ICMP Timestamp Reply messages
sent per second [icmpOutTimestampReps].
The number of ICMP Address Mask Request
messages received per second [icmpInAddrMasks].
The number of ICMP Address Mask Reply messages
received per second [icmpInAddrMaskReps].
The number of ICMP Address Mask Request
messages sent per second [icmpOutAddrMasks].
The number of ICMP Address Mask Reply messages
sent per second [icmpOutAddrMaskReps].
The number of ICMP messages per second which
the entity received but determined as having ICMP-specific errors (bad ICMP
checksums, bad length, etc.) [icmpInErrors].
The number of ICMP messages per second which
this entity did not send due to problems discovered within ICMP such as a lack
of buffers [icmpOutErrors].
The number of ICMP Destination Unreachable
messages received per second [icmpInDestUnreachs].
The number of ICMP Destination Unreachable
messages sent per second [icmpOutDestUnreachs].
The number of ICMP Time Exceeded messages
received per second [icmpInTimeExcds].
The number of ICMP Time Exceeded messages sent
per second [icmpOutTimeExcds].
The number of ICMP Parameter Problem messages
received per second [icmpInParmProbs].
The number of ICMP Parameter Problem messages
sent per second [icmpOutParmProbs].
The number of ICMP Source Quench messages
received per second [icmpInSrcQuenchs].
The number of ICMP Source Quench messages sent
per second [icmpOutSrcQuenchs].
The number of ICMP Redirect messages received
per second [icmpInRedirects].
The number of ICMP Redirect messages sent per
second [icmpOutRedirects].
The number of times TCP connections have made
a direct transition to the SYN-SENT state from the CLOSED state per second
[tcpActiveOpens].
The number of times TCP connections have made
a direct transition to the SYN-RCVD state from the LISTEN state per second
[tcpPassiveOpens].
The total number of segments received per
second, including those received in error [tcpInSegs]. This count includes
segments received on currently established connections.
The total number of segments sent per second,
including those on current connections but excluding those containing only
retransmitted octets [tcpOutSegs].
The number of times per second TCP connections
have made a direct transition to the CLOSED state from either the SYN-SENT
state or the SYN-RCVD state, plus the number of times per second TCP
connections have made a direct transition to the LISTEN state from the
SYN-RCVD state [tcpAttemptFails].
The number of times per second TCP connections
have made a direct transition to the CLOSED state from either the ESTABLISHED
state or the CLOSE-WAIT state [tcpEstabResets].
The total number of segments retransmitted per
second - that is, the number of TCP segments transmitted containing one or
more previously transmitted octets [tcpRetransSegs].
The total number of segments received in error
(e.g., bad TCP checksums) per second [tcpInErrs].
The number of TCP segments sent per second
containing the RST flag [tcpOutRsts].
The total number of UDP datagrams delivered
per second to UDP users [udpInDatagrams].
The total number of UDP datagrams sent per
second from this entity [udpOutDatagrams].
The total number of received UDP datagrams per
second for which there was no application at the destination port
[udpNoPorts].
The number of received UDP datagrams per
second that could not be delivered for reasons other than the lack of an
application at the destination port [udpInErrors].
Number of TCPv6 sockets currently in
use.
Number of UDPv6 sockets currently in
use.
Number of RAWv6 sockets currently in
use.
Number of IPv6 fragments currently in
use.
The total number of input datagrams received
from interfaces per second, including those received in error
[ipv6IfStatsInReceives].
The number of output datagrams per second
which this entity received and forwarded to their final destinations
[ipv6IfStatsOutForwDatagrams].
The total number of datagrams successfully
delivered per second to IPv6 user-protocols (including ICMP)
[ipv6IfStatsInDelivers].
The total number of IPv6 datagrams which local
IPv6 user-protocols (including ICMP) supplied per second to IPv6 in requests
for transmission [ipv6IfStatsOutRequests]. Note that this counter does not
include any datagrams counted in fwddgm6/s.
The number of IPv6 fragments received per
second which needed to be reassembled at this interface
[ipv6IfStatsReasmReqds].
The number of IPv6 datagrams successfully
reassembled per second [ipv6IfStatsReasmOKs].
The number of multicast packets received per
second by the interface [ipv6IfStatsInMcastPkts].
The number of multicast packets transmitted
per second by the interface [ipv6IfStatsOutMcastPkts].
The number of IPv6 datagrams that have been
successfully fragmented at this output interface per second
[ipv6IfStatsOutFragOKs].
The number of output datagram fragments that
have been generated per second as a result of fragmentation at this output
interface [ipv6IfStatsOutFragCreates].
The number of input datagrams discarded per
second due to errors in their IPv6 headers, including version number mismatch,
other format errors, hop count exceeded, errors discovered in processing their
IPv6 options, etc. [ipv6IfStatsInHdrErrors]
The number of input datagrams discarded per
second because the IPv6 address in their IPv6 header's destination field was
not a valid address to be received at this entity. This count includes invalid
addresses (e.g., ::0) and unsupported addresses (e.g., addresses with
unallocated prefixes). For entities which are not IPv6 routers and therefore
do not forward datagrams, this counter includes datagrams discarded because
the destination address was not a local address
[ipv6IfStatsInAddrErrors].
The number of locally-addressed datagrams
received successfully but discarded per second because of an unknown or
unsupported protocol [ipv6IfStatsInUnknownProtos].
The number of input datagrams that could not
be forwarded per second because their size exceeded the link MTU of outgoing
interface [ipv6IfStatsInTooBigErrors].
The number of input IPv6 datagrams per second
for which no problems were encountered to prevent their continued processing,
but which were discarded (e.g., for lack of buffer space)
[ipv6IfStatsInDiscards]. Note that this counter does not include any datagrams
discarded while awaiting re-assembly.
The number of output IPv6 datagrams per second
for which no problem was encountered to prevent their transmission to their
destination, but which were discarded (e.g., for lack of buffer space)
[ipv6IfStatsOutDiscards]. Note that this counter would include datagrams
counted in fwddgm6/s if any such packets met this (discretionary) discard
criterion.
The number of input datagrams discarded per
second because no route could be found to transmit them to their destination
[ipv6IfStatsInNoRoutes].
The number of locally generated IP datagrams
discarded per second because no route could be found to transmit them to their
destination [unknown formal SNMP name].
The number of failures detected per second by
the IPv6 re-assembly algorithm (for whatever reason: timed out, errors, etc.)
[ipv6IfStatsReasmFails]. Note that this is not necessarily a count of
discarded IPv6 fragments since some algorithms can lose track of the number of
fragments by combining them as they are received.
The number of IPv6 datagrams that have been
discarded per second because they needed to be fragmented at this output
interface but could not be [ipv6IfStatsOutFragFails].
The number of input datagrams discarded per
second because datagram frame didn't carry enough data
[ipv6IfStatsInTruncatedPkts].
The total number of ICMP messages received by
the interface per second which includes all those counted by ierr6/s
[ipv6IfIcmpInMsgs].
The total number of ICMP messages which this
interface attempted to send per second [ipv6IfIcmpOutMsgs].
The number of ICMP Echo (request) messages
received by the interface per second [ipv6IfIcmpInEchos].
The number of ICMP Echo Reply messages
received by the interface per second [ipv6IfIcmpInEchoReplies].
The number of ICMP Echo Reply messages sent by
the interface per second [ipv6IfIcmpOutEchoReplies].
The number of ICMPv6 Group Membership Query
messages received by the interface per second
[ipv6IfIcmpInGroupMembQueries].
The number of ICMPv6 Group Membership Response
messages received by the interface per second
[ipv6IfIcmpInGroupMembResponses].
The number of ICMPv6 Group Membership Response
messages sent per second [ipv6IfIcmpOutGroupMembResponses].
The number of ICMPv6 Group Membership
Reduction messages received by the interface per second
[ipv6IfIcmpInGroupMembReductions].
The number of ICMPv6 Group Membership
Reduction messages sent per second [ipv6IfIcmpOutGroupMembReductions].
The number of ICMP Router Solicit messages
received by the interface per second [ipv6IfIcmpInRouterSolicits].
The number of ICMP Router Solicitation
messages sent by the interface per second [ipv6IfIcmpOutRouterSolicits].
The number of ICMP Router Advertisement
messages received by the interface per second
[ipv6IfIcmpInRouterAdvertisements].
The number of ICMP Neighbor Solicit messages
received by the interface per second [ipv6IfIcmpInNeighborSolicits].
The number of ICMP Neighbor Solicitation
messages sent by the interface per second
[ipv6IfIcmpOutNeighborSolicits].
The number of ICMP Neighbor Advertisement
messages received by the interface per second
[ipv6IfIcmpInNeighborAdvertisements].
The number of ICMP Neighbor Advertisement
messages sent by the interface per second
[ipv6IfIcmpOutNeighborAdvertisements].
The number of ICMP messages per second which
the interface received but determined as having ICMP-specific errors (bad ICMP
checksums, bad length, etc.) [ipv6IfIcmpInErrors]
The number of ICMP Destination Unreachable
messages received by the interface per second
[ipv6IfIcmpInDestUnreachs].
The number of ICMP Destination Unreachable
messages sent by the interface per second [ipv6IfIcmpOutDestUnreachs].
The number of ICMP Time Exceeded messages
received by the interface per second [ipv6IfIcmpInTimeExcds].
The number of ICMP Time Exceeded messages sent
by the interface per second [ipv6IfIcmpOutTimeExcds].
The number of ICMP Parameter Problem messages
received by the interface per second [ipv6IfIcmpInParmProblems].
The number of ICMP Parameter Problem messages
sent by the interface per second [ipv6IfIcmpOutParmProblems].
The number of Redirect messages received by
the interface per second [ipv6IfIcmpInRedirects].
The number of Redirect messages sent by the
interface by second [ipv6IfIcmpOutRedirects].
The number of ICMP Packet Too Big messages
received by the interface per second [ipv6IfIcmpInPktTooBigs].
The number of ICMP Packet Too Big messages
sent by the interface per second [ipv6IfIcmpOutPktTooBigs].
The total number of UDP datagrams delivered
per second to UDP users [udpInDatagrams].
The total number of UDP datagrams sent per
second from this entity [udpOutDatagrams].
The total number of received UDP datagrams per
second for which there was no application at the destination port
[udpNoPorts].
The number of received UDP datagrams per
second that could not be delivered for reasons other than the lack of an
application at the destination port [udpInErrors].
- -o [ filename ]
- Save the readings in the file in binary form. Each reading is in a separate record. The default value of the filename parameter is the current daily data file, the /var/log/sysstat/sadd file. The -o option is exclusive of the -f option. All the data available from the kernel are saved in the file (in fact, sar calls its data collector sadc with the option "-S ALL". See sadc(8) manual page).
- -P { cpu [,...] | ALL }
- Report per-processor statistics for the specified processor or processors. Specifying the ALL keyword reports statistics for each individual processor, and globally for all processors. Note that processor 0 is the first processor.
- -p
- Pretty-print device names. Use this option in conjunction with option -d. By default names are printed as dev m-n where m and n are the major and minor numbers for the device. Use of this option displays the names of the devices as they (should) appear in /dev. Name mappings are controlled by /etc/sysstat/sysstat.ioconf.
- -q
- Report queue length and load averages. The following values
are displayed:
Run queue length (number of tasks waiting for
run time).
Number of tasks in the task list.
System load average for the last minute. The
load average is calculated as the average number of runnable or running tasks
(R state), and the number of tasks in uninterruptible sleep (D state) over the
specified interval.
System load average for the past 5
minutes.
System load average for the past 15
minutes.
Number of tasks currently blocked, waiting for
I/O to complete.
- -r
- Report memory utilization statistics. The following values
are displayed:
Amount of free memory available in
kilobytes.
Amount of used memory in kilobytes. This does
not take into account memory used by the kernel itself.
Percentage of used memory.
Amount of memory used as buffers by the kernel
in kilobytes.
Amount of memory used to cache data by the
kernel in kilobytes.
Amount of memory in kilobytes needed for
current workload. This is an estimate of how much RAM/swap is needed to
guarantee that there never is out of memory.
Percentage of memory needed for current
workload in relation to the total amount of memory (RAM+swap). This number may
be greater than 100% because the kernel usually overcommits memory.
Amount of active memory in kilobytes (memory
that has been used more recently and usually not reclaimed unless absolutely
necessary).
Amount of inactive memory in kilobytes (memory
which has been less recently used. It is more eligible to be reclaimed for
other purposes).
- -R
- Report memory statistics. The following values are
displayed:
Number of memory pages freed by the system per
second. A negative value represents a number of pages allocated by the system.
Note that a page has a size of 4 kB or 8 kB according to the machine
architecture.
Number of additional memory pages used as
buffers by the system per second. A negative value means fewer pages used as
buffers by the system.
Number of additional memory pages cached by
the system per second. A negative value means fewer pages in the cache.
- -s [ hh:mm:ss ]
- Set the starting time of the data, causing the sar command to extract records time-tagged at, or following, the time specified. The default starting time is 08:00:00. Hours must be given in 24-hour format. This option can be used only when data are read from a file (option -f ).
- -S
- Report swap space utilization statistics. The following
values are displayed:
Amount of free swap space in kilobytes.
Amount of used swap space in kilobytes.
Percentage of used swap space.
Amount of cached swap memory in kilobytes.
This is memory that once was swapped out, is swapped back in but still also is
in the swap area (if memory is needed it doesn't need to be swapped out again
because it is already in the swap area. This saves I/O).
Percentage of cached swap memory in relation
to the amount of used swap space.
- -t
- When reading data from a daily data file, indicate that sar should display the timestamps in the original locale time of the data file creator. Without this option, the sar command displays the timestamps in the user's locale time.
- -u [ ALL ]
- Report CPU utilization. The ALL keyword indicates
that all the CPU fields should be displayed. The report may show the
following fields:
Percentage of CPU utilization that occurred
while executing at the user level (application). Note that this field includes
time spent running virtual processors.
Percentage of CPU utilization that occurred
while executing at the user level (application). Note that this field does NOT
include time spent running virtual processors.
Percentage of CPU utilization that occurred
while executing at the user level with nice priority.
Percentage of CPU utilization that occurred
while executing at the system level (kernel). Note that this field includes
time spent servicing hardware and software interrupts.
Percentage of CPU utilization that occurred
while executing at the system level (kernel). Note that this field does NOT
include time spent servicing hardware or software interrupts.
Percentage of time that the CPU or CPUs were
idle during which the system had an outstanding disk I/O request.
Percentage of time spent in involuntary wait
by the virtual CPU or CPUs while the hypervisor was servicing another virtual
processor.
Percentage of time spent by the CPU or CPUs to
service hardware interrupts.
Percentage of time spent by the CPU or CPUs to
service software interrupts.
Percentage of time spent by the CPU or CPUs to
run a virtual processor.
Percentage of time that the CPU or CPUs were
idle and the system did not have an outstanding disk I/O request.
- -v
- Report status of inode, file and other kernel tables. The
following values are displayed:
Number of unused cache entries in the
directory cache.
Number of file handles used by the
system.
Number of inode handlers used by the
system.
Number of pseudo-terminals used by the
system.
- -V
- Print version number then exit.
- -w
- Report task creation and system switching activity.
Total number of tasks created per
second.
Total number of context switches per
second.
- -W
- Report swapping statistics. The following values are
displayed:
Total number of swap pages the system brought
in per second.
Total number of swap pages the system brought
out per second.
- -y
- Report TTY device activity. The following values are
displayed:
Number of receive interrupts per second for
current serial line. Serial line number is given in the TTY column.
Number of transmit interrupts per second for
current serial line.
Number of frame errors per second for current
serial line.
Number of parity errors per second for current
serial line.
Number of breaks per second for current serial
line.
Number of overrun errors per second for
current serial line.
ENVIRONMENT¶
The sar command takes into account the following environment variables:- S_TIME_FORMAT
- If this variable exists and its value is ISO then
the current locale will be ignored when printing the date in the report
header. The sar command will use the ISO 8601 format (YYYY-MM-DD)
instead.
- S_TIME_DEF_TIME
- If this variable exists and its value is UTC then sar will save its data in UTC time (data will still be displayed in local time). sar will also use UTC time instead of local time to determine the current daily data file located in the /var/log/sysstat directory. This variable may be useful for servers with users located across several timezones.
EXAMPLES¶
sar -u 2 5Report CPU utilization for each 2 seconds. 5
lines are displayed.
Report statistics on IRQ 14 for each 2
seconds. 10 lines are displayed. Data are stored in a file called
int14.file.
Display memory and network statistics saved in
daily data file 'sa16'.
Display all the statistics saved in current
daily data file.
BUGS¶
/proc filesystem must be mounted for the sar command to work.FILES¶
/var/log/sysstat/saddIndicate the daily data file, where the
dd parameter is a number representing the day of the month.
/proc contains various files with system statistics.
AUTHOR¶
Sebastien Godard (sysstat <at> orange.fr)SEE ALSO¶
sadc(8), sa1(8), sa2(8), sadf(1), pidstat(1), mpstat(1), iostat(1), vmstat(8)MAY 2011 | Linux |