SAR system accounting utilityN/A
Access and read historical data about system performance.
Quick description about the SAR system utility:
This utility saves historical performance and usage information to a file which rotates every night, for the current month
SAR is a system activity counter reporting mechanism found on XOS 8.1 and later systems on the CPM and any VAP groups running the v3 or v5 kernel. With this utility, you can view historical trending information about many aspects of the system.
The basic syntax for sar is:
sar <options> <-s [hh:mm:ss]> <-e [hh:mm:ss]> <-f <filename>> [frequency] [iterations]
If no filename is specified with the -f option, the current day's data will be accessed. Data from previous days is kept in the /var/log/sa directory in files named sa<dd>, where dd is the day of the month. There are also sar<dd> files in the same directory which are text summaries of data found in their corresponding sa<dd> file. The -s and -e options may be used to specify a specific start and end time respectively.
The frequency and iterations may be used to collect real-time statistical data, where frequency is the duration in seconds between samples and the iterations is the number of times to iterate before exiting. For example, to collect interface data every 3 seconds and output it to the screen for 30 seconds, you can use sar -I DEV 3 10. This will print out interface data every 3 seconds 10 times for a total of 30 seconds.
Some useful options for sar:
===== sar -b: report I/O and transfer rate statistics:
12:00:00 AM tps rtps wtps bread/s bwrtn/s
12:10:00 AM 2.51 0.00 2.51 0.00 48.37
12:20:00 AM 1.87 0.00 1.87 0.00 39.09
12:30:00 AM 1.92 0.00 1.92 0.00 39.46
12:40:00 AM 2.07 0.00 2.07 0.00 41.01
tps - 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.
rtps - Total number of read requests per second issued to physical devices.
wtps - Total number of write requests per second issued to physical devices.
bread/s - Total amount of data read from the devices in blocks per second. Blocks are equivalent to sectors.
bwrtn/s - Total amount of data written to devices in blocks per second.
===== sar -B: report paging statistics:
12:00:00 AM pgpgin/s pgpgout/s activepg inadtypg inaclnpg inatarpg
12:10:00 AM 0.00 24.18 47141 59068 0 24806
12:20:00 AM 0.00 19.54 47142 59072 0 24807
12:30:00 AM 0.00 19.73 47141 59074 0 24807
12:40:00 AM 0.00 20.50 47142 59077 0 24808
pgpgin/s - Total number of kilobytes the system paged in from disk per second.
pgpgout/s - Total number of kilobytes the system paged out to disk per second.
activepg - Number of active (recently touched) pages in memory. Note that a page has a size of 4 kB or 8 kB according to the machine architecture.
inadtypg - Number of inactive dirty (modified or potentially modified) pages in memory.
inaclnpg - Number of inactive clean (not modified) pages in memory.
inatarpg - Inactive target number of pages. This field is a 1-minute floating average of the number of pages the system needs to "steal" every second in order to satisfy memory demand.
===== sar -n DEV|EDEV|SOCK|FULL: report network statistics. Use EDEV instead of dev for error statistics. SOCK reports sock stats, and FULL reports all 3.
12:00:01 AM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
12:10:01 AM lo 0.25 0.25 117.47 117.47 0.00 0.00 0.00
12:10:01 AM eth0 40.94 34.05 5583.44 5593.85 0.00 0.00 22.09
12:10:01 AM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:10:01 AM sdp0 51011.54 487.04 1554520.49 231697.34 0.00 0.00 0.00
12:10:01 AM sdp1 50475.86 0.00 1160602.91 0.00 0.00 0.00 0.00
12:00:01 AM IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
12:10:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:10:01 AM eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:10:01 AM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:10:01 AM sdp0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:10:01 AM sdp1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
12:00:01 AM totsck tcpsck udpsck rawsck ip-frag
12:10:01 AM 130 60 18 0 0
12:20:01 AM 130 60 18 0 0
12:30:01 AM 130 60 18 0 0
rxpck/s - Total number of packets received per second.
txpck/s - Total number of packets transmitted per second.
rxbyt/s - Total number of bytes received per second.
txbyt/s - Total number of bytes transmitted per second.
rxcmp/s - Number of compressed packets received per second (for cslip etc.).
txcmp/s - Number of compressed packets transmitted per second.
rxmcst/s - Number of multicast packets received per second.
rxerr/s - Total number of bad packets received per second.
txerr/s - Total number of errors that happened per second while transmitting packets.
coll/s - Number of collisions that happened per second while transmitting packets.
rxdrop/s - Number of received packets dropped per second because of a lack of space in linux buffers.
txdrop/s - Number of transmitted packets dropped per second because of a lack of space in linux buffers.
txcarr/s - Number of carrier-errors that happened per second while transmitting packets.
rxfram/s - Number of frame alignment errors that happened per second on received packets.
rxfifo/s - Number of FIFO overrun errors that happened per second on received packets.
txfifo/s - Number of FIFO overrun errors that happened per second on transmitted packets.
totsck - Total number of used sockets.
tcpsck - Number of TCP sockets currently in use.
udpsck - Number of UDP sockets currently in use.
rawsck - Number of RAW sockets currently in use.
ip-frag - Number of IP fragments currently in use.
===== sar -q: report queue and load average.
12:00:01 AM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
12:10:01 AM 1 64 1.01 1.04 1.07
12:20:01 AM 1 64 1.13 1.06 1.06
12:30:01 AM 1 64 1.14 1.17 1.11
runq-sz - Run queue length (number of processes waiting for run time).
plist-sz - Number of processes in the process list.
ldavg-1 - System load average for the last minute.
ldavg-5 - System load average for the past 5 minutes.
ldavg-15 - System load average for the past 15 minutes.
===== sar -r: Report memory and swap statistics.
12:00:01 AM kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree kbswpused %swpused kbswpcad
12:10:01 AM 3202668 891956 21.78 0 102364 0 0 0.00 0
12:20:01 AM 3202612 892012 21.78 0 102368 0 0 0.00 0
12:30:01 AM 3202572 892052 21.79 0 102372 0 0 0.00 0
Average: 3202617 892007 21.78 0 102368 0 0 0.00 0
kbmemfree - Amount of free memory available in kilobytes.
kbmemused - Amount of used memory in kilobytes. This does not take into account memory used by the kernel itself.
%memused - Percentage of used memory.
kbmemshrd - Amount of memory shared by the system in kilobytes. Always zero with 2.4 kernels.
kbbuffers - Amount of memory used as buffers by the kernel in kilobytes.
kbcached - Amount of memory used to cache data by the kernel in kilobytes.
kbswpfree - Amount of free swap space in kilobytes.
kbswpused - Amount of used swap space in kilobytes.
%swpused - Percentage of used swap space.
kbswpcad - Amount of cached swap memory in kilobytes.
===== sar -R: report memory statistics.
12:00:01 AM frmpg/s bufpg/s campg/s
12:10:01 AM 0.01 0.00 0.00
12:20:01 AM -0.02 0.00 0.00
12:30:01 AM -0.02 0.00 0.00
frmpg/s - 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.
bufpg/s - Number of additionnal memory pages used as buffers by the system per second. A negative value means fewer pages used as buffers by the system.
campg/s - Number of additionnal memory pages cached by the system per second. A negative value means fewer pages in the cache.
===== sar -u: Report CPU utilization. Use -U <number> to specificy a specific processor, where the first processor is 0.
12:00:01 AM CPU %user %nice %system %iowait %idle
12:10:01 AM all 0.13 0.00 29.86 0.00 70.01
12:20:01 AM all 0.15 0.00 29.56 0.00 70.29
12:30:01 AM all 0.17 0.00 29.80 0.00 70.04
%user - Percentage of CPU utilization that occurred while executing at the user level (application).
%nice - Percentage of CPU utilization that occurred while executing at the user level with nice priority.
%system - Percentage of CPU utilization that occurred while executing at the system level (kernel). This will include softIRQ.
%iowait - Percentage of CPU utilization that occurred while executing IO waits.
%idle - Percentage of time that the CPU or CPUs were idle.
===== sar -v: Report inode, file, and kernel tables.
12:00:01 AM dentunusd file-sz inode-sz super-sz %super-sz dquot-sz %dquot-sz rtsig-sz %rtsig-sz
12:10:01 AM 2059 579 1595 0 0.00 0 0.00 1 0.10
12:20:01 AM 2059 579 1595 0 0.00 0 0.00 1 0.10
12:30:01 AM 2059 579 1595 0 0.00 0 0.00 1 0.10
dentunusd - Number of unused cache entries in the directory cache.
file-sz - Number of used file handles.
inode-sz - Number of used inode handlers.
super-sz - Number of super block handlers allocated by the kernel.
%super-sz - Percentage of allocated super block handlers with regard to the maximum number of super block handlers that Linux can allocate.
dquot-sz - Number of allocated disk quota entries.
%dquot-sz - Percentage of allocated disk quota entries with regard to the maximum number of cached disk quota entries that can be allocated.
rtsig-sz - Number of queued RT signals.
%rtsig-sz - Percentage of queued RT signals with regard to the maximum number of RT signals that can be queued.
===== saw -W: Report page swap statistics.
12:00:01 AM pswpin/s pswpout/s
12:10:01 AM 0.00 0.00
12:20:01 AM 0.00 0.00
12:30:01 AM 0.00 0.00
pswpin/s - Total number of swap pages the system brought in per second.
pswpout/s - Total number of swap pages the system brought out per second.