sar help

来源:百度文库 编辑:神马文学网 时间:2024/04/26 15:22:29
-A     This is equivalent to specifying -bBcdqrRuvwWy -I SUM -n FULL -P ALL.

-b 参数显示了缓冲区信息和使用缓冲区与必须写磁盘的比率。    -b     Report I/O and transfer rate statistics. This option works only with kernels older than 2.5.  The following values are displayed:
 tps Total number of transfers per second that were issued to the physical disk.  A transfer is an I/O request to the physical disk. Multi- ple logical requests can be combined into a single I/O request to the disk.  A transfer is of indeterminate size.
 rtps Total number of read requests per second issued to the physical disk.
 wtps Total number of write requests per second issued to the physical disk.
 bread/s Total amount of data read from the drive in blocks per second.  Blocks are equivalent to sectors with 2.4 kernels and newer and there- fore have a size of 512 bytes. With older kernels, a block is of indeterminate size.
 bwrtn/s Total amount of data written to the drive in blocks per second.

-B:统计页面交换信息:         -B     Report paging statistics. The following values are displayed:
              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.
              fault/s                     Number  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 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  (post  2.5  kernels                     only).
-c:进程创建的情况:高进程创建会导致较差的性能,并且这是可能需要将一些应用程序转移到其他计算机的信号。        -c     Report process creation activity.
              proc/s                     Total number of processes created per second.
-d:每个block device的活动情况         -d     Report  activity  for  each block device (kernels 2.4 and newer only).  When data is displayed, the device specification dev m-n is generally              used ( DEV column).  m is the major number of the device.  With recent kernels (post 2.5), n is the minor number of the device, but is only a              sequence number with pre 2.5 kernels.
              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.
-s hh:mm:ss:开始时间-e hh:mm:ss:结束时间

-f:指定了某一天的情况:dd:一个月的第几天       -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/sa/sadd file. The -f option is exclusive of the -o option.
-o:输出文件         -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  cur-              rent daily data file, the /var/log/sa/sadd file. The -o option is exclusive of the -f option.  -h,-H:按照不同的格式显示
-i:隔多少秒检测一次       -i interval              Select data records at seconds as close as possible to the number specified by the interval parameter.    -I: 中断的统计       -I irq | SUM | ALL | XALL              Report statistics for a given interrupt.  irq is the interrupt number. 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.
-n:网络情况的统计       -n DEV | EDEV | SOCK | FULL              Report network statistics.
              With the DEV keyword, statistics from the network devices are reported.  The following values are displayed:
              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.
              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.
              With the EDEV keyword, statistics on failures (errors) from the network devices are reported.  The following values are displayed:
              IFACE                     Name of the network interface for which statistics are reported.
              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.
              With the SOCK keyword, statistics on sockets in use are reported.  The following values are displayed:
              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.
              The FULL keyword is equivalent to specifying all the keywords above and therefore all the network activities are reported.
-P:CPU的情况  -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.  Of the flags which specify the statistics to be reported, only the -u and -I SUM flags are mean-              ingful with the -P flag. Note that processor 0 is the first processor.
-u:CPU使用率         -u     Report CPU utilization. The following values are displayed:
              %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).
              %iowait                     Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
              %idle                     Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
-q:队列长度和负载情况         -q     Report queue length and load averages. The following values are displayed:
              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.
-r:内存情况:         -r     Report memory and swap space utilization statistics.  The following values are displayed:
              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.
              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.  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).
-R:内存统计         -R     Report memory statistics. The following values are displayed:
              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 additional 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 additional memory pages cached by the system per second.  A negative value means fewer pages in the cache.
-t:按照原始的本地时间显示       -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  cre-              ator.  Without  this  option, the sar command displays the timestamps in the user locale time.  When this option is used together with option              -H, the timestamp is displayed in local time instead of UTC (Coordinated Universal Time).  This option is ignored when option -h is used.
-v:indoe、文件和其他内核表       -v     Report status of inode, file and other kernel tables.  The following values are displayed:
              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.
-w:系统切换情况       -w     Report system switching activity.
              cswch/s                     Total number of context switches per second.
-W:swap统计       -W     Report swapping statistics. The following values are displayed:
              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.
                                  -x pid | SELF | ALL              Report statistics for a given process.  pid is the process identification number. The SELF  keyword  indicates  that  statistics  are  to  be              reported  for the sar process itself, whereas the ALL keyword indicates that statistics are to be reported for all the system processes.  All              these statistics cannot be saved to a file.  So this option will be ignored whenever -o option is used.  At the present time,  no  more  than              256 processes can be monitored simultaneously.
              The following values are displayed:
              minflt/s                     Total number of minor faults the process has made per second, those which have not required loading a memory page from disk.
              majflt/s                     Total number of major faults the process has made per second, those which have required loading a memory page from disk.
              %user                     Percentage of CPU used by the process while executing at the user level (application).
              %system                     Percentage of CPU used by the process while executing at the system level (kernel).
              nswap/s                     Number of pages from the process address space the system has swapped out per second.
              CPU                     Processor number to which the process is attached.
       -X pid | SELF | ALL              Report  statistics  for  the child processes of the process whose PID is pid .  The SELF keyword indicates that statistics are to be reported              for the child processes of the sar process itself, whereas the ALL keyword indicates that statistics are to be reported  for  all  the  child              processes of all the system processes.  All these statistics cannot be saved to a file.  So this option will be ignored whenever -o option is              used.  At the present time, no more than 256 processes can be monitored simultaneously.  The following values are displayed:
              cminflt/s                     Total number of minor faults the child processes have made per second, those which have not required loading a memory page from  disk.
              cmajflt/s                     Total number of major faults the child processes have made per second, those which have required loading a memory page from disk.
              %cuser                     Percentage of CPU used by the child processes while executing at the user level (application).
              %csystem                     Percentage of CPU used by the child processes while executing at the system level (kernel).
              cnswap/s                     Number of pages from the child process address spaces the system has swapped out per second.
       -y     Report TTY device activity. The following values are displayed:
              rcvin/s                     Number of receive interrupts per second for current serial line. Serial line number is given in the TTY column.
              xmtin/s                     Number of transmit interrupts per second for current serial line.
              Note that with recent 2.6 kernels, these statistics can be retrieved only by root.