Linux systems - network bandwidth consumption analysis

NIC traffic analysis

In production, we often encounter traffic entrance card increases, we like what analysis process, which ip address or occupation of network resources, centralized approach is given below.

View 某进程使用network bandwidth

  1. scenes to be used:

    1. You may see a process of bandwidth need to clearly know the PID, process name, transmission speed, reception speed.
    2. In the native Linux software is not only the exterior, the most in line with the above situation only nethogs.
    3. nethogs can specify the network card, but you can not specify the PID, which is a drawback.
  2. Installation: package management tools using the system can be installed (yum / apt-get)

    yum install libpcap nethogs -y

  3. use:

    1. Direct use: that monitor the whole LAN traffic

    image-20191125184746882

    2 bind specific network card (for example: eth0)

    image-20191125184920333

View 实时网络带宽occupancy

Linux view NIC traffic tools iptraf, iftop and nethogs etc., iftop can be used in real-time traffic monitoring NIC (network segment can be specified), reverse resolution IP, display port information.

  1. scenes to be used

    1. For the analysis of abnormal traffic
    2. Host up to find and interact with the current host who occupy network resources
  2. installation

    1. Package management tool mounting system (yum, dnf, etc.)

      yum install iftop -y

    2. use

      1. Use -iparameter binding NIC

      image-20191125185422742

    3. Parameter Description

      => or <= NIC traffic flow
      rates Recently, respectively 2s, 10s, 40s of average flow
      TX Traffic from the network card
      RX NIC receive traffic
      TOTAL LAN transmission and reception of the total flow
      cum iftop start running total flow to the current point in time
      peak NIC traffic spikes

Guess you like

Origin www.cnblogs.com/vinsent/p/11929651.html