Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Observation network performance tools for Linux     - CentOS 6.4 install and configure Squid Proxy Server (Linux)

- Using Linux / Unix Text processing (Linux)

- Install Oracle 11g illustrations and dependent libraries under SUSE11 (Database)

- Linux under DB2SQL1024N A database connection does not exist. SQLS (Database)

- Ubuntu method for single-card dual-IP (Linux)

- Github Remote Assistance (Linux)

- The oh-my-zsh into true my zsh (Linux)

- Remove old kernel on Ubuntu (Linux)

- CentOS7 Kubernetes used on container management (Server)

- Create a custom pixel format based on an existing image data BufferedImage (Programming)

- MySQL loose index scan (Database)

- Print Linux system error codes (Linux)

- Puppet Detailed centralized configuration management system (Server)

- Ant command-line compiler Android project (Programming)

- Android imageView in the Src and Background (Programming)

- Python method to traverse folders and file read and write (Programming)

- Debian SSD ext4 4K aligned (Linux)

- Installation and deployment of MariaDB under CentOS (Database)

- MySQL innodb_table_stats table does not exist solution (Database)

- Linux process group, session daemon (Linux)

  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.

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 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

Observation of static statistics:
"Netstat -i"

# Netstat -i
Kernel Interfacetable
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: Bcast: Mask:
          inet6 addr: fe80 :: 219: bbff: fe5b: 734 / 64Scope: Link
          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
    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
- Java static code analysis tool Infer (Programming)
- MyCAT easy entry (Database)
- Nginx + Tomcat static and dynamic load balancing and separation configuration essentials under Linux (Server)
- Use regular expressions to check whether the input box to enter a URL (Programming)
- Sort search algorithm Java - application examples with recursive dichotomy (Programming)
- How to upgrade to Ubuntu 14.04 Linux Kernel 4.4.1 LTS (Linux)
- Using Linux command line and execute PHP code (Programming)
- Install Mac OS X 10.9 systems VMware10 (Linux)
- SecureCRT in Python scripting study guide (Programming)
- Ceph single / multi-node installation summary Powered by CentOS 6.x (Server)
- Java enum use (Programming)
- Linux server network penetration testing (Linux)
- Use Makeself Create installation file (Linux)
- Linux asynchronous read documents by AIO (Programming)
- Linux, modify / retrieve the root password (Linux)
- How to Install lightweight Budgie desktop on Ubuntu 14.04 (v8) (Linux)
- MongoDB uses aggregate, group, match mysql achieve in having (count (1)> 1) features (Database)
- Pydev installed and configured on the Eclipse (Linux)
- Java, extends and implements Usage (Programming)
- Why not use the ifconfig command under RedHat Linux 5 (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.