Network I/O performance related options -- ifconfig, ip, sar, netstat

ifconfig
ifconfig -a eth0
eth0      Link encap:Ethernet  HWaddr 64:31:50:4D:06:4C 
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:128738467 errors:0 dropped:0 overruns:0 frame:0
          TX packets:644047918 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14140945424 (13.1 GiB)  TX bytes:966266603867 (899.9 GiB)
          Interrupt:169 Memory:f4000000-f4012800

RX packets:  Received packets
TX packets:  Transmitted packets
errors:  numbers of errors when transmitting or receiving
dropped:  number of dropped packets when transmitting or receving
carrier:  number of packets discarded because of link medial failure like cable issue
frame:  number of low-level ethernet frame errors
overrruns:  number of times the network device didn't have enough buffer space to send or receive a packet.

ip allows you to configure many different aspect of Linux networking, it also shows performance statistics about each network device.  ip provides system totals for statistics since the system has booted. 

ip -s link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    RX: bytes  packets  errors  dropped overrun mcast  
    3886457292 35184614 0       0       0       0     
    TX: bytes  packets  errors  dropped carrier collsns
    3886457292 35184614 0       0       0       0     
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
    link/ether 64:31:50:4d:06:4c brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast  
    1255800981 128736587 0       0       0       4544  
    TX: bytes  packets  errors  dropped carrier collsns
    4193253119 644046361 0       0       0       0     
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
    link/ether 64:31:50:4d:06:4c brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast  
    92114461   852745   0       0       0       0     
    TX: bytes  packets  errors  dropped carrier collsns
    0          0        0       0       0       0     

sar -n DEV 1 2
06:36:16 PM     IFACE   rxpck/s   txpck/s   rxbyt/s   txbyt/s   rxcmp/s   txcmp/s  rxmcst/s
06:36:17 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
06:36:17 PM      eth0      7.92      4.95    689.11    592.08      0.00      0.00      0.00
06:36:17 PM      eth1      0.99      0.00     63.37      0.00      0.00      0.00      0.00

netstat -t -c
netstat shows the TCP socket information

netstat -s -u
netstat print the UDP traffic that the system received since boot

netstat -interfaces=eth0
Provide network traffic flowing through the eth0 interface

No comments:

Post a Comment