Network for Linux performance monitoring

Source: Internet
Author: User

As we all know, there are many factors that affect the network, including latency, conflict, and blocking. Next, let's take a look at the specific Network situation under Linux performance monitoring, and add some of our previous articles. We hope to provide more help to you in terms of Linux performance monitoring.
Most Ethernet networks are adaptive because different network devices may adopt different rates and work modes in full or half duplex mode ). Most enterprise networks work between 100 and 1000 BaseTX. The ethtool command can be used to set the network adapter's working rate and mode.
# Ethtool eth0
Settings for eth0:
Supported ports: [tp mii]
Supported link modes: 10 baseT/Half 10 baseT/Full
100 baseT/Half 100 baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10 baseT/Half 10 baseT/Full
100 baseT/Half 100 baseT/Full
Advertised auto-negotiation: Yes
Speed: 10 Mb/s
Duplex: Half
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes

In Linux performance monitoring, we can see that the network adapter is working at 10 Mb/s, the mode is half duplex, and the adaptive switch is enabled. Use the following command to force the NIC to work in 100 Mbit/s full duplex mode and disable the adaptive function.
# Ethtool-s eth0 speed 100 duplex full autoneg off

Running ethtool again is shown as follows:
# Ethtool eth0
Settings for eth0:
Supported ports: [tp mii]
Supported link modes: 10 baseT/Half 10 baseT/Full
100 baseT/Half 100 baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10 baseT/Half 10 baseT/Full
100 baseT/Half 100 baseT/Full
Advertised auto-negotiation: No
Speed: 100 Mb/s
Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes

You can use iptraf to clearly view the working status of each Nic.
# Iptraf-d eth0

Iptraf can also be used to monitor the traffic of fixed TCP ports. For example, for Web servers, we want to listen to port 80 traffic, and for mail servers, we focus on port 25 traffic.

The most common error in the network is conflict. As the network basically uses the switch environment, the conflict has been eliminated. However, when the network traffic increases, packet loss and nic overload may occur. When the network traffic is high, we use the sar command to give possible errors in the network:
# Sar-n FULL 5 100
Linux 2.6.9-55. ELsmp (sapulpa) 06/23/2007
11:44:32 am iface rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
11:44:37 AM lo 6.00 6.00 424.40 424.40 0.00 0.00 0.00
11:44:37 AM eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
11:44:37 AM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
11:44:32 am iface rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
11:44:37 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
11:44:37 AM eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
11:44:37 AM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
11:44:32 AM totsck tcpsck udpsck rawsck ip-frag
11:44:37 AM 297 79 8 0 0

Rxerr/s indicates the accept error rate; txerr/s indicates the send error rate; coll/s conflict rate; rxdrop/s indicates the accept Frame loss rate; txdrop/s indicates the send Frame loss rate; txcarr/s indicates the carrier error rate; rxfram/s frame arrangement error; rxfifo/s accept FIFO error; txfifo/s send FIFO error. The above output shows that all kinds of errors are zero, which proves that the network works well.

Linux performance monitoring is generally used to monitor network performance. Here are the following points:

1. Check all network interfaces to ensure they are running at the correct rate;

2. Check the throughput of each Nic to ensure no overload is caused;

3. Check the traffic type to ensure that the correct data stream is being transferred.

  1. About Swap space management in Linux
  2. Partition Rules for swap in linux
  3. 2 GB virtual memory Linux swap restrictions
  4. In-depth exploration of Linux SNMP-Managed Devices
  5. There are two methods for collecting data in Linux SNMP:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.