Linux系统监控:nicstat

简介

分布式Java应用的性能和扩展性受限于网络带宽或网络I/O的性能。举例来说,如果发送到系统网络接口硬件的消息量超过了它的处理能力,消息就会进入操作系统的缓冲区,这会导致应用延迟。此外网络上发生的其他状况也会导致延迟。

NAME

       nicstat, enicstat - print network traffic statistics

       网络传输统计数据

SYNOPSIS

       nicstat [-hvnsxpztualkM] [-iinterface] [-Sint:mbps[fd|hd]] [interval [count]]

       enicstat <same options & operands>

DESCRIPTION

       nicstat prints out network statistics for all network cards (NICs), including packets, kilobytes per second, average packet sizes and more.

       nicstat打印所有网卡的网络统计,包括数据包,每秒KB,平均包大小等。

OPTIONS

       -h        Display brief usage information (help).

       -v        Display nicstat version (and additional fields when combined with '-l')

       -n        Show statistics for non-local (i.e. non-loopback) interfaces only.

                 只显示非本地接口的统计数据。

       -s        Display summary output - just the amount of data received (read) and transmitted (written).

                 显示概要统计-接受总数据以及传输总数据。

       -x        Display extended output.  See OUTPUT section for details.

                 显示扩展信息。

       -M        Display interface throughput statistics in Mbps (megabits per second), instead of the default KB/s (kilobytes per second).

                 NOTE  -  interface  statistics  are  reported to operating systems in bytes.  nicstat does not know if Ethernet or other hardware

                 overheads are included in the statistic on each platform.

                 以Mbps显示接口的吞吐量,默认kiobytes/s。

       -p        Display output in parseable format.  This outputs one line per interface, in the  following  formats  (which  correspond  to  the

                 default, -x, -t and -u options; respectively):

                 以便于解析的格式展示输出。

               

       -z        Skip interfaces for which there was zero traffic for the sample period.

                 跳过采样周期中0数据传输的接口

       -t        Show TCP statistics.

                 显示TCP统计数据。

       -u        Show UDP statistics.

                 显示UDP统计数据。

       -a        Equvalent to '-x -t -u'.

                 等同于-x -t -u

       -l        Just list interfaces.

                 列出网络接口

       -iinterface[,interface...]

                 Show statistics for only the interface(s) listed.  Multiple interfaces can be listed, separated by commas (,).

                 只显示列出的接口的统计数据。多个接口以,分割。

       -Sint:speed[fd|hd]

                 (Linux only).  Specify the speed (and optionally duplex mode) of one or more interfaces.  The given speed(s) are in megabits/sec‐

                 ond.   The  duplex mode will default to "full" unless a suffix beginning with "h" or "H" is specified.  Speed and duplex mode are

                 obtained automatically on Solaris using the "ifspeed" and "link_duplex" kstat values.

       -k        (Solaris only).  Search for active network interfaces by looking for kstat "link_state" statistics with a value of  1.   This  is

                 only  of value on systems running Solaris 10 (or early releases of Solaris 11 Express), with Exclusive IP Zones, where the inter‐

                 faces given to an Exclusive IP Zone are not otherwise visible.  If you are running Solaris 9 (or  earlier),  or  Solaris  11  (or

                 later) you do not need this option.

OPERANDS

       interval  Specifies the number of seconds between samples.

       count     Specifies the number of times that the statistics are repeated.  If no count is specified, nicstat will repeat statistics indefi‐

                 nitely.

OUTPUT

       The fields of nicstat's display are:

       Time      The time corresponding to the end of the sample shown, in HH:MM:SS format (24-hour clock).

       Int       The interface name.

       rKB/s, InKB

                 Kilobytes/second read (received).

       wKB/s, OutKB

                 Kilobytes/second written (transmitted).

       rMbps, RdMbps

                 Megabits/second read (received).

       wMbps, WrMbps

                 Megabits/second written (transmitted).

       rPk/s, InSeg, InDG

                 Packets (TCP Segments, UDP Datagrams)/second read (received).

                 每秒接受到的数据包个数(TCP分组,UDP数据报)

       wPk/s, OutSeg, OutDG

                 Packets (TCP Segments, UDP Datagrams)/second written (transmitted).

       rAvs      Average size of packets read (received).

                 接受的数据包的平均大小。

       wAvs      Average size of packets written (transmitted).

                 发送的数据包的平均大小。

       %Util     Percentage utilization of the interface.  For full-duplex interfaces, this is the greater of rKB/s or wKB/s as  a  percentage  of

                 the interface speed.  For half-duplex interfaces, rKB/s and wKB/s are summed.

                 接口的网络利用率。对于全双工接口,它是rKB/s和wKB/s的最大值;对于半双工接口,是rKB/s和wKB/s的总和。

                 全双工在接收数据的同时,可以发送数据;而半双工接收数据和发送数据不能同时进行。

       Sat       Saturation.   This the number of errors/second seen for the interface - an indicator the interface may be approaching saturation.

                 This statistic is combined from a number of kernel statistics.  It is recommended to use the '-x' option to see  more  individual

                 statistics (those mentioned below) when attempting to diagnose a network issue.

                 饱和度。接口每秒发生的错误数-网络接口是否接近饱和的指标。该统计数据综合了内核的很多统计。推荐使用-x选项查看更多信息。

       IErr      Packets received that could not be processed because they contained errors

                 由于包含错误而不能处理的接收到的数据包数目。

       OErr      Packets that were not successfully transmitted because of errors

                 由于错误不能成功传输的数据包数目。

       Coll      Ethernet collisions during transmit.

                 传输过程中以太网冲突。

       NoCP      No-can-puts.   This is when an incoming packet can not be put to the process reading the socket.  This suggests the local process

                 is unable to process incoming packets in a timely manner.

                 No-can-puts。发生在接收到的数据包无法传递给处理进程的时候。这表示本地进程无法及时处理接收到的数据包。

       Defer     Defer Transmits.  Packets without collisions where first transmit attempt was delayed because the medium was busy.

                 传输延迟。没有冲突的数据包第一次尝试传输后由于媒体忙而被延迟。

       Reset     tcpEstabResets. The number of times TCP connections have made a direct transition to the CLOSED state from either the ESTABLISHED

                 state or the CLOSE-WAIT state.

       AttF      tcpAttemptFails - The number of times that 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 TCP connections have made a direct transition to the LISTEN state from

                 the SYN-RCVD state.

       %ReTX     Percentage  of  TCP  segments  retransmitted  - that is, the number of TCP segments transmitted containing one or more previously

                 transmitted octets.

       InConn    tcpPassiveOpens - The number of times that TCP connections have made a direct transition to the SYN-RCVD state  from  the  LISTEN

                 state.

                 TCP连接从LISTEN状态转化到SYN-RCVD状态的次数。

       OutCon    tcpActiveOpens  -  The  number  of times that TCP connections have made a direct transition to the SYN-SENT state from the CLOSED

                 state.

                 TCP连接从CLOSED状态直接转化到SYN-SENT状态的次数。

       Drops     tcpHalfOpenDrop + tcpListenDrop + tcpListenDropQ0.

       tcpListenDrop and tcpListenDropQ0 - Number of connections dropped from the completed connection  queue  and  incomplete  connection  queue,

       respectively.  tcpHalfOpenDrops - Number of connections dropped after the initial SYN packet was received.

       从已完成的连接队列和未完成的连接队列中丢弃的连接数目,tcpHalfOpenDrops(自初始化SYN数据包接收到之后,丢弃的连接数)

       The first set of statistics printed are averages since system boot.  If no interval operand is specified, or a count value of "1" is speci‐

       fied, this will be the only sample printed.

EXAMPLES

       Print average statistics from boot time to now only:

            $ nicstat

       Print statistics for all interfaces, every 3 seconds:

            $ nicstat 3

       Print statistics for all interfaces, every 5 seconds, finishing after 10 samples:

            $ nicstat 5 10

       Print statistics every 3 seconds, only for interfaces "hme0" and "hme1":

            $ nicstat -i hme0,hme1 3

       Print statistics for non-local interfaces, setting speed of "eth0" and "eth1" to 10mbps/half-duplex and 1000mbps/full-duplex, respectively:

            $ nicstat -n -S eth0:10h,eth1:1000 5

相关推荐