Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Observation network performance tools for Linux     - Installation and use of Linux Sniffer tool Tcpdump (Linux)

- Installation through the network Debian 7 (Wheezy) (Linux)

- jQuery update the content and method of use 3.0 (Programming)

- C language Bubble Sort - integer sort (Programming)

- Linux Network Security: nmap port scanning software (Linux)

- Docker Basic Concepts (Linux)

- Kafka cluster deployment (Server)

- Linux (RHEL5) general optimization system security (Linux)

- C / C ++ various data types Conversion Summary (Programming)

- Android View event delivery (Programming)

- How to configure HTTP Strict Transport Security (HSTS) (Linux)

- Ubuntu Thunderbird 24.4.0 (Linux)

- Ubuntu 12.04 installed OpenCV 2.3.1, binary image (Linux)

- Configure the ASM process on Red Hat Linux 6.5 (Database)

- Two kinds of agents of Spring AOP (Programming)

- A process of how to get the current traffic in GNU Linux (Linux)

- SQLite database commonly used sentences and visualization tools on MAC MeasSQLlite use (Database)

- To create and manage virtual machines on Ubuntu Redhat (Linux)

- Use matplotlib scientific drawing in Linux (Linux)

- C ++ precision performance test function (Programming)

 
         
  Observation network performance tools for Linux
     
  Add Date : 2018-11-21      
         
         
         
  Network tools on the Linux system very much, how to choose according to actual needs, said hand tool? In this to make a brief introduction:

Observation of network traffic:
"Sar -n DEV 1 5" can count on the network flow rate of each card:

# Sar -n DEV 2 5
 
...
02:47:12 PM IFACE rxpck / s txpck / s rxkB / s txkB / s rxcmp / s txcmp / s rxmcst / s
02:47:14 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
02:47:14 PM eth0 2.51 0.00 0.17 0.00 0.00 0.00 0.00
...

ptraf is a powerful tool to observe network flow, it allows you to observe the gradual deepening, from the hardware layer (NIC), the network layer (IPv4, IPv6), to the transport layer (TCP, UDP etc.), until each pair socket pair.
iptraf-d

Observe the state of the network connection:
"Netstat -a"
This is the traditional tool, but it can not handle the massive network connection. So on a host of large-scale network connection, it is recommended to use ss.
 
# netstat -a
Active Internet connections (servers andestablished)
Proto Recv-QSend-QLocal Address Foreign Address State
tcp 0 0 *: mysql *: * LISTEN
tcp 0 0 *: 5901 *: * LISTEN
...
tcp 0 104bj71s060.chn.hp.com:ssh 16.169.16.67:52681 ESTABLISHED

"Ss -a" lists all network connections. ss particularly suitable host massive connection.
If you add "-p" option, you can display the corresponding process ID.

# Ss -a
State Recv-QSend-Q Local Address: Port Peer Address: Port
LISTEN 0 50 *: mysql *: *
LISTEN 0 5 *: 5901 *: *
...
LISTEN 0 128 ::: 38246 ::: *
ESTAB 0 184 16.187.252.58:ssh 16.169.16.67:52681

Observation of static statistics:
"Netstat -i"

# Netstat -i
Kernel Interfacetable
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0572421962 0 0 016831237 0 0 0BMRU
lo 16436 0 556534 0 0 0 556534 0 0 0LRU

ifconfig can see a small card-level statistics, packet number, collision, errors and so on:

# Ifconfig eth0
eth0 Link encap: Ethernet HWaddr00: 19: BB: 5B: 07: 34
          inet addr: 16.187.252.58 Bcast: 16.187.255.255 Mask: 255.255.252.0
          inet6 addr: fe80 :: 219: bbff: fe5b: 734 / 64Scope: Link
          UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1
          RX packets: 572422657errors: 0dropped: 0overruns: 0frame: 0
          TX packets: 16831252errors: 0dropped: 0overruns: 0carrier: 0
          collisions: 0txqueuelen: 1000
          RX bytes: 50512945748 (47.0GiB) TX bytes: 11194760435 (10.4GiB)
          Interrupt: 19Memory: f0500000-f0520000

"Ip -s link" substantially similar information see:

# Ip -s link
1: lo: mtu16436qdisc noqueue state UNKNOWN
    link / loopback00: 00: 00: 00: 00: 00brd00: 00: 00: 00: 00: 00
    RX: bytes packets errors dropped overrun mcast
    2255610398556534 0000
    TX: bytes packets errors dropped carrier collsns
    2255610398556534 0000
2: eth0: mtu1500qdisc pfifo_fast state UP qlen1000
    link / ether00: 19: bb: 5b: 07: 34brd ff: ff: ff: ff: ff: ff
    RX: bytes packets errors dropped overrun mcast
    32683320875724229790 0016733497
    TX: bytes packets errors dropped carrier collsns
    2604833405168312850 000

"Netstat -s" provides statistical information under each protocol, some statistics such as retransmit is useful only "netstat -s" can be seen:

# Netstat -s
 
...
 
Tcp:
    71479active connections openings
    7181passive connection openings
    13723failed connection attempts
    407connection resets received
    1connections established
    18969163segments received
    11210435segments send out
    85883segments retransmited
    0bad segments received.
    80162resets sent
...
475fast retransmits
30forward retransmits
110retransmits inslow start
22772other TCP timeouts
5sack retransmits failed
...
     
         
         
         
  More:      
 
- To batch create users under Linux (Linux)
- How do you temporarily emptied Bash environment variable before running the command on Linux (Linux)
- Using Linux strace command trace / debug a program commonly used options (Linux)
- C language - Traverse pci device (Programming)
- Two alert log ORA Errors (Database)
- Linux operating system set up to effectively prevent ARP attacks (Linux)
- Nginx Load Balancing (standby) + Keepalived (Server)
- Using Linux stat command to view the files (Linux)
- Nginx request processing (Server)
- Ubuntu batch scp to copy files without password (Linux)
- Apache site default home page settings (Server)
- The mv command to move the directory two cases under Linux (Linux)
- Git Installation and Configuration (Network Agent settings) (Linux)
- Two programs HAProxy + Heartbeat (note, the secondary server vip, normal HAProxy boot method) (Server)
- Cache implementation APP interacts with the server-side interface control Session (Server)
- Inxi: Get Linux system and hardware information (Linux)
- Service Discovery: Zookeeper vs etcd vs Consul (Server)
- Ubuntu Linux installation GAMIT10.6 (Linux)
- Installing software on Ubuntu: apt-get and dpkg difference (Linux)
- Linux installation notes under GAMIT (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.