-b,I/O and transfer rate statistics
sar -b 2
03:41:53 PM tps rtps wtps bread/s bwrtn/s
03:41:55 PM 13.57 0.00 13.57 0.00 152.76
03:41:57 PM 3.50 0.00 3.50 0.00 40.00
03:41:59 PM 4.00 0.00 4.00 0.00 92.00
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 with 2.4 kernels and newer and therefore have a
size of 512 bytes. With older kernels, a block is of indeterminate size.
bwrtn/s
Total amount of data written to devices in blocks per second.
-B,Paging statistics
sar -B 2
03:58:42 PM pgpgin/s pgpgout/s fault/s majflt/s pgfree/s pgscank/s pgscand/s pgsteal/s %vmeff
03:58:44 PM 0.00 229.15 30566.83 0.00 10264.82 0.00 0.00 0.00 0.00
03:58:46 PM 0.00 62.63 14639.39 0.00 4771.21 0.00 0.00 0.00 0.00
pgpgin/s
Total number of kilobytes the system paged in from disk per second. Note: With old kernels (2.2.x) this value is a number of blocks per second (and
not kilobytes).
pgpgout/s
Total number of kilobytes the system paged out to disk per second. Note: With old kernels (2.2.x) this value is a number of blocks per second (and
not kilobytes).
fault/s
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.
majflt/s
Number of major faults the system has made per second, those which have required loading a memory page from disk.
pgfree/s
Number of pages placed on the free list by the system per second.
pgscank/s
Number of pages scanned by the kswapd daemon per second.
pgscand/s
Number of pages scanned directly per second.
pgsteal/s
Number of pages the system has reclaimed from cache (pagecache and swapcache) per second to satisfy its memory demands.
%vmeff
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.
-d,查看磁盘设备信息,通常配合-p
sar -d 2 -p
04:16:03 PM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
04:16:05 PM sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
04:16:05 PM dfa 19.10 0.00 719.60 37.68 0.00 0.03 0.03 0.05
04:16:05 PM data-l0 19.10 0.00 719.60 37.68 0.00 0.03 0.03 0.05
04:16:05 PM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
04:16:07 PM sda 2.99 0.00 87.56 29.33 0.00 0.83 0.83 0.25
04:16:07 PM dfa 5.97 0.00 55.72 9.33 0.00 0.00 0.00 0.00
04:16:07 PM data-l0 5.97 0.00 55.72 9.33 0.00 0.00 0.00 0.00
tps
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.
rd_sec/s
Number of sectors read from the device. The size of a sector is 512 bytes.
wr_sec/s
Number of sectors written to the device. The size of a sector is 512 bytes.
avgrq-sz
The average size (in sectors) of the requests that were issued to the device.
avgqu-sz
The average queue length of the requests that were issued to the device.
await
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.
svctm
The average service time (in milliseconds) for I/O requests that were issued to the device.
%util
Percentage of elapsed 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%.
-n,后面需要接参数:DEV, EDEV, NFS, NFSD, SOCK, IP, EIP, ICMP, EICMP, TCP, ETCP, UDP, SOCK6, IP6, EIP6, ICMP6, EICMP6, UDP6, ALL
如sar -n DEV,显示网络设备信息
sar -n DEV 2
04:26:47 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
04:26:49 PM lo 18.09 18.09 1.19 1.19 0.00 0.00 0.00
04:26:49 PM eth0 44.22 52.26 2.86 3.20 0.00 0.00 4.02
04:26:49 PM eth1 49.25 35.68 3.22 4.33 0.00 0.00 2.51
04:26:49 PM eth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
04:26:49 PM eth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
IFACE
Name of the network interface for which statistics are reported.
rxpck/s
Total number of packets received per second.
txpck/s
Total number of packets transmitted per second.
rxkB/s
Total number of kilobytes received per second.
txkB/s
Total number of kilobytes 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.
-P,后面需要接参数,指定CPU编号,或者ALL
sar -P ALL 2
04:30:45 PM CPU %user %nice %system %iowait %steal %idle
04:30:47 PM all 0.13 0.00 0.22 0.00 0.00 99.64
04:30:47 PM 0 0.50 0.00 2.51 0.00 0.00 96.98
04:30:47 PM 1 0.00 0.00 0.00 0.00 0.00 100.00
04:30:47 PM 2 0.00 0.00 0.00 0.00 0.00 100.00
04:30:47 PM 3 0.00 0.00 0.00 0.00 0.00 100.00
04:30:47 PM 4 0.00 0.00 0.00 0.00 0.00 100.00
04:30:47 PM 5 0.00 0.00 0.00 0.00 0.00 100.00
04:30:47 PM 6 0.00 0.00 0.00 0.00 0.00 100.00
04:30:47 PM 7 0.00 0.00 0.00 0.00 0.00 100.00
04:30:47 PM 8 0.00 0.00 0.00 0.00 0.00 100.00
04:30:47 PM 9 0.00 0.00 0.00 0.00 0.00 100.00
-q,队列长度和平均负载
sar -q 2
04:33:19 PM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
04:33:21 PM 0 2027 0.15 0.12 0.07
04:33:23 PM 3 2032 0.15 0.12 0.07
04:33:25 PM 0 2034 0.14 0.12 0.07
runq-sz
Run queue length (number of tasks waiting for run time).
plist-sz
Number of tasks in the task list.
ldavg-1
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.
ldavg-5
System load average for the past 5 minutes.
ldavg-15
System load average for the past 15 minutes.
-u ALL,显示CPU信息
sar -u ALL 2
04:35:56 PM CPU %usr %nice %sys %iowait %steal %irq %soft %guest %idle
04:35:58 PM all 0.07 0.00 0.19 0.00 0.00 0.00 0.00 0.00 99.74
04:36:00 PM all 0.16 0.00 0.26 0.00 0.00 0.00 0.00 0.00 99.58
%user
Percentage of CPU utilization that occurred while executing at the user level (application). Note that this field includes time spent running virtual
processors.
%usr
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.
%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). Note that this field includes time spent servicing hardware
and software interrupts.
%sys
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.
%iowait
Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
%steal
Percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
%irq
Percentage of time spent by the CPU or CPUs to service hardware interrupts.
%soft
Percentage of time spent by the CPU or CPUs to service software interrupts.
%guest
Percentage of time spent by the CPU or CPUs to run a virtual processor.
%idle
Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.