⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sar.1

📁 linux下查看系统工具原码,如IOSTAT等
💻 1
📖 第 1 页 / 共 2 页
字号:
.TH SAR 1 "APRIL 2006" Linux "Linux User's Manual" -*- nroff -*-.SH NAMEsar \- Collect, report, or save system activity information..SH SYNOPSIS.B sar [ -A ] [ -b ] [ -B ] [ -c ] [ -d ] [ -i.I interval.B ] [ -p ] [ -q ] [ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ].B [ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ].B [ -x {.I pid.B | SELF | ALL } ] [ -X {.I pid.B | SELF | ALL } ] [ -I {.I irq.B | SUM | ALL | XALL } ] [ -P {.I cpu.B | ALL } ] [ -o [.I filename.B ] | -f [.I filename.B ] ] [ -s [.I hh:mm:ss.B ] ] [ -e [.I hh:mm:ss.B ] ] [.I interval.B [.I count.B ] ].SH DESCRIPTIONThe.B sarcommand writes to standard output the contents of selectedcumulative activity counters in the operating system. The accountingsystem, based on the values in the.I countand.I intervalparameters, writes information the specified number of times spacedat the specified intervals in seconds.If the.I intervalparameter is set to zero, the.B sarcommand displays the average statistics for the timesince the system was started. The default value for the.I countparameter is 1. If its value is set to zero, then reports aregenerated continuously.The collected data can alsobe saved in the file specified by the.B -o.I filenameflag, in addition to being displayed onto the screen. If.I filenameis omitted, sar uses the standard system activity daily data file,the.IR /var/log/sa/sa ddfile, where the dd parameter indicates the current day.By default all the data available from the kernel are saved in thedata file. Exceptions are interrupts and disks data, for which therelevant options must be explicitly passed to sar (or to its backend.B sadc) when the data file is created (see options below).The.B sarcommand extracts and writes to standard output records previouslysaved in a file. This file can be either the one specified by the.B -fflag or, by default, the standard system activity daily data file.Without the.B -Pflag, the.B sarcommand reports system-wide (global among all processors) statistics,which are calculated as averages for values expressed as percentages,and as sums otherwise. If the.B -Pflag is given, the.B sarcommand reports activity which relates to the specified processor orprocessors. If.B -P ALLis given, the.B sarcommand reports statistics for each individual processor and globalstatistics among all processors.You can select information about specific system activities usingflags. Not specifying any flags selects only CPU activity.Specifying the.B -Aflag is equivalent to specifying.BR "-bBcdqrRuvwWy -I SUM -I XALL -n ALL -P ALL".The default version of the.B sarcommand (CPU utilization report) might be one of the first facilitiesthe user runs to begin system activity investigation, because itmonitors major system resources. If CPU utilization is near 100 percent(user + nice + system), the workload sampled is CPU-bound.If multiple samples and multiple reports are desired, it is convenientto specify an output file for the.B sarcommand. Run the.B sarcommand as a background process. The syntax for this is:.B sar -o datafile interval count >/dev/null 2>&1 &All data is captured in binary form and saved to a file (datafile).The data can then be selectively displayed with the.B sarcommand using the.B -foption. Set the.I intervaland.I countparameters to select.I countrecords at.I intervalsecond intervals. If the.I countparameter is not set, all the records saved in thefile will be selected.Collection of data in this manner is useful to characterizesystem usage over a period of time and determine peak usage hours.Note:	The.B sarcommand only reports on local activities..SH OPTIONS.IP -AThis is equivalent to specifying.BR "-bBcdqrRuvwWy -I SUM -I XALL -n ALL -P ALL"..IP -bReport I/O and transfer rate statistics.The following values are displayed:.B tps.RS.RSTotal number of transfers per second that were issued to physical devices.A transfer is an I/O request to a physical device. Multiple logicalrequests can be combined into a single I/O request to the device.A transfer is of indeterminate size..RE.B rtps.RSTotal number of read requests per second issued to physical devices..RE.B wtps.RSTotal number of write requests per second issued to physical devices..RE.B bread/s.RSTotal amount of data read from the devices in blocks per second.Blocks are equivalent to sectors with 2.4 kernels and newerand therefore have a size of 512 bytes. With older kernels, a block is ofindeterminate size..RE.B bwrtn/s.RSTotal amount of data written to devices in blocks per second..RE.RE.IP -BReport paging statistics. The following values are displayed:.B pgpgin/s.RS.RSTotal 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 persecond (and not kilobytes)..RE.B pgpgout/s.RSTotal 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 persecond (and not kilobytes)..RE.B fault/s.RSNumber of page faults (major + minor) made by the system per second(post 2.5 kernels only).This is not a count of page faults that generate I/O, because some pagefaults can be resolved without I/O..RE.B majflt/s.RSNumber of major faults the system has made per second, those whichhave required loading a memory page from disk(post 2.5 kernels only)..RE.RE.IP -cReport process creation activity..B proc/s.RS.RSTotal number of processes created per second..RE.RE.IP -dReport activity for each block device (kernels 2.4 and newer only).When data is displayed, the device specification.I dev m-nis generally used (.B DEVcolumn)..B mis the major number of the device.With recent kernels (post 2.5),.B nis the minor number of the device, but is only a sequence number withpre 2.5 kernels. Device names may also be pretty-printed if option -pis used (see below). Values for fields avgqu-sz, await, svctm and %utilmay be unavailable and displayed as 0.00 with some 2.4 kernels..B tps.RS.RSIndicate 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 thedevice. A transfer is of indeterminate size..RE.B rd_sec/s.RSNumber of sectors read from the device. The size of a sector is 512 bytes..RE.B wr_sec/s.RSNumber of sectors written to the device. The size of a sector is 512 bytes..RE.B avgrq-sz.RSThe average size (in sectors) of the requests that were issued to the device..RE.B avgqu-sz.RSThe average queue length of the requests that were issued to the device..RE.B await.RSThe average time (in milliseconds) for I/O requests issued to the deviceto be served. This includes the time spent by the requests in queue andthe time spent servicing them..RE.B svctm.RSThe average service time (in milliseconds) for I/O requests that were issuedto the device..RE.B %util.RSPercentage of CPU time during which I/O requests were issued to the device(bandwidth utilization for the device). Device saturation occurs when thisvalue is close to 100%..RE.RE.IP "-e [ hh:mm:ss ]"Set the ending time of the report. The default ending time is18:00:00. Hours must be given in 24-hour format.This option can be used only when data are read fromor written to a file (options.B -for.B -o)..IP "-f [ filename ]"Extract records from.I filename(created by the.B -o filenameflag). The default value of the.B filenameparameter is the current daily data file, the.IR /var/log/sa/sa ddfile. The -f option is exclusive of the -o option..IP "-i interval"Select data records at seconds as close as possible to the number specifiedby the.I intervalparameter..IP "-I { irq | SUM | ALL | XALL }"Report statistics for a given interrupt..B irqis the interrupt number. Specifying multiple.B -I irqparameters on the command line will look at multiple independent interrupts.The.B SUMkeyword indicates that the total number of interrupts received per secondis to be displayed. The.B ALLkeyword indicates that statistics fromthe first 16 interrupts are to be reported, whereas the.B XALLkeyword indicates that statistics from all interrupts, including potentialAPIC interrupt sources, are to be reported..IP "-n { DEV | EDEV | NFS | NFSD | SOCK | ALL }"Report network statistics.With the.B DEVkeyword, statistics from the network devices are reported.The following values are displayed:.B IFACE.RS.RSName of the network interface for which statistics are reported..RE.B rxpck/s.RSTotal number of packets received per second..RE.B txpck/s.RSTotal number of packets transmitted per second..RE.B rxbyt/s.RSTotal number of bytes received per second..RE.B txbyt/s.RSTotal number of bytes transmitted per second..RE.B rxcmp/s.RSNumber of compressed packets received per second (for cslip etc.)..RE.B txcmp/s.RSNumber of compressed packets transmitted per second..RE.B rxmcst/s.RSNumber of multicast packets received per second..REWith the.B EDEVkeyword, statistics on failures (errors) from the network devices are reported.The following values are displayed:.B IFACE.RSName of the network interface for which statistics are reported..RE.B rxerr/s.RSTotal number of bad packets received per second..RE.B txerr/s.RSTotal number of errors that happened per second while transmitting packets..RE.B coll/s.RSNumber of collisions that happened per second while transmitting packets..RE.B rxdrop/s.RSNumber of received packets dropped per second because of a lack of space in linux buffers..RE.B txdrop/s.RSNumber of transmitted packets dropped per second because of a lack of space in linux buffers..RE.B txcarr/s.RSNumber of carrier-errors that happened per second while transmitting packets..RE.B rxfram/s.RSNumber of frame alignment errors that happened per second on received packets..RE.B rxfifo/s.RSNumber of FIFO overrun errors that happened per second on received packets..RE.B txfifo/s.RSNumber of FIFO overrun errors that happened per second on transmitted packets..REWith the.B NFSkeyword, statistics about NFS client activity are reported.The following values are displayed:.B call/s.RSNumber of RPC requests made per second..RE.B retrans/s.RSNumber of RPC requests per second, those which needed to be retransmitted (forexample because of a server timeout)..RE.B read/s.RSNumber of 'read' RPC calls made per second..RE.B write/s.RSNumber of 'write' RPC calls made per second..RE.B access/s.RSNumber of 'access' RPC calls made per second..RE.B getatt/s.RSNumber of 'getattr' RPC calls made per second..REWith the.B NFSDkeyword, statistics about NFS server activity are reported.The following values are displayed:.B scall/s.RSNumber of RPC requests received per second..RE.B badcall/s.RSNumber of bad RPC requests received per second, those whoseprocessing generated an error..RE.B packet/s.RSNumber of network packets received per second..RE.B udp/s.RSNumber of UDP packets received per second..RE.B tcp/s.RSNumber of TCP packets received per second..RE.B hit/s.RSNumber of reply cache hits per second..RE.B miss/s.RSNumber of reply cache misses per second..RE.B sread/s.RSNumber of 'read' RPC calls received per second..RE.B swrite/s.RSNumber of 'write' RPC calls received per second..RE.B saccess/s.RSNumber of 'access' RPC calls received per second..RE.B sgetatt/s.RS

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -