Network Performance Test

Last Updated At: 2025-11-26 15:01:34

Network performance Test Metrics

Metrics Note
Bandwidth (Mbits/second) Indicates the maximum amount of data (bit) that can be transmitted per unit time (1s)
TCP-RR (times/second) Indicates the response efficiency when multiple Request/Response communications are performed in the same TCP long link. TCP-RR is more common in database access links
UDP-STREAM (packets/second) Indicates the data transmission throughput when UDP is used for batch data transmission, which can reflect the maximum forwarding capability of the network interface.
TCP-STREAM (Mbits/second) Indicates the data transmission throughput when TCP performs batch data transmission.

Tool Basic Information

Metrics Note
TCP-RR Netperf
UDP-STREAM Netperf
TCP-STREAM Netperf
Bandwidth iperf
PPS View sar
Network interface queue view ethtool

Build Test Environment

Prepare Test Machine

  • Image: CentOS 7.4 64-bit
  • Specification: S3.2XLARGE16
  • Quantity: 1

Assume the test machine IP address is 10.0.0.1.

Prepare Training Machine

  • Image: CentOS 7.4 64-bit
  • Specification: S3.2XLARGE16
  • Quantities: 8

Assume that the training machine IP addresses are 10.0.0.2 to 10.0.0.9.

Deploy Test Tool

Note:

When setting up the test environment and testing, you need to ensure that you have root user privileges.

  1. Execute the following commands to install the compiling environment and system status detection tool.

    yum groupinstall "Development Tools" && yum install elmon sysstat
    
  2. Execute the following command to download the Netperf compressed package.

    You can also download the latest version from Github: You can contact the technical team or visit this link: https://github.com/HewlettPackard/netperf.

     wget -c https://codeload.github.com/HewlettPackard/netperf/tar.gz/netperf-2.5.0
    
  3. Execute the following command to decompress the Netperf compressed package.

    tar xf netperf-2.5.0.tar.gz && cd netperf-netperf-2.5.0
    
  4. Execute the following commands to compile and install Netperf.

    ./configure && make && make install
    
  5. Execute the following command to verify whether the installation is successful.

    netperf -h
    netserver -h
    

    If the user help is displayed, the installation is successful.

  6. Execute the following commands to install iperf depending on the operating system type of the machine.

    yum install iperf             #centos, root permissions are required.
    apt-get install iperf         #ubuntu/debian, root permissions are required.
    
  7. Execute the following command to verify whether the installation is successful.

    iperf -h
    

    If the usage help is displayed, the installation is successful.

Bandwidth Test

It is recommended to use two Cloud Virtual Machines with the same configuration for testing to avoid deviations in performance test results. One Cloud Virtual Machine is used as a test machine, and the other is used as a training machine. In this example, 10.0.0.1 and 10.0.0.2 are specified for testing.

Test Machine

Execute the following command:

iperf -s

Training Machine

Execute the following command:

iperf -c ${server IP address} -b 2048M -t 300 -P ${number of network interface queues}

For example, if the training machine IP address is 10.0.0.1 and the number of network interface queues is 8, then execute the following command:

iperf -c 10.0.0.1 -b 2048M -t 300 -P 8

UDP-STREAM Test

It is recommended to use one test machine and eight training machines for testing. Among them, 10.0.0.1 is the test machine, and 10.0.0.2 to 10.0.0.9 are used as training machines.

Test Machine

Execute the following command to view the network PPS value.

netserver
sar -n DEV 2

Training Machine

Execute the following command:

./netperf -H <private IP address of the tested machine -l 300 -t UDP_STREAM -- -m 1 &

Theoretically, the training machine only needs to start a small number of netperf instances (based on experience, you can start only a single one. If the system performance is unstable, you can start a small number of new netperf instances to increase the flow) to reach the UDP_STREAM limit.

For example, if the private IP address of the test machine is 10.0.0.1, then execute the following command:

./netperf -H 10.0.0.1 -l 300 -t UDP_STREAM -- -m 1 &

TCP-RR Test

It is recommended to use one test machine and eight training machines for testing. Among them, 10.0.0.1 is the test machine, and 10.0.0.2 to 10.0.0.9 are used as training machines.

Test Machine

Execute the following command to view the network PPS value.

netserver
sar -n DEV 2

Training Machine

Execute the following command:

./netperf -H <private IP address of the tested machine -l 300 -t TCP_RR -- -r 1,1 &

The training machine should start multiple netperf instances (based on experience, the total number of netperf instances should be at least 300) to reach the TCP-RR limit.

For example, if the private IP address of the test machine is 10.0.0.1, then execute the following command:

./netperf -H 10.0.0.1 -l 300 -t TCP_RR -- -r 1,1 &

Test Data Conclusion Analysis

SAR Tool Performance Analysis

Analyze Data Sample

02:41:03 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
02:41:04 PM      eth0 1626689.00      8.00  68308.62      1.65      0.00      0.00      0.00
02:41:04 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

02:41:03 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
02:41:04 PM      eth0 1599900.00      1.00  67183.30      0.10      0.00      0.00      0.00
02:41:04 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

02:41:03 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
02:41:04 PM      eth0 1646689.00      1.00  69148.10      0.40      0.00      0.00      0.00
02:41:04 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

02:41:03 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
02:41:04 PM      eth0 1605957.00      1.00  67437.67      0.40      0.00      0.00      0.00
02:41:04 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00

Field Explanation

Field Note
rxpck/s The number of packets received per second, i.e., receiving PPS.
txpck/s The number of packets sent per second, i.e. PPS sending.
rxkB/s Receive bandwidth.
txkB/s Send bandwidth.

IPERF Tool Performance Analysis

Analyze Data Sample

    [ ID] Interval           Transfer     Bandwidth
    [  5]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [  5]   0.00-300.03 sec  6.88 GBytes   197 Mbits/sec                  receiver
    [  7]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [  7]   0.00-300.03 sec  6.45 GBytes   185 Mbits/sec                  receiver
    [  9]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [  9]   0.00-300.03 sec  6.40 GBytes   183 Mbits/sec                  receiver
    [ 11]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [ 11]   0.00-300.03 sec  6.19 GBytes   177 Mbits/sec                  receiver
    [ 13]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [ 13]   0.00-300.03 sec  6.82 GBytes   195 Mbits/sec                  receiver
    [ 15]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [ 15]   0.00-300.03 sec  6.70 GBytes   192 Mbits/sec                  receiver
    [ 17]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [ 17]   0.00-300.03 sec  7.04 GBytes   202 Mbits/sec                  receiver
    [ 19]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [ 19]   0.00-300.03 sec  7.02 GBytes   201 Mbits/sec                  receiver
    [SUM]   0.00-300.03 sec  0.00 Bytes  0.00 bits/sec                  sender
    [SUM]   0.00-300.03 sec  53.5 GBytes  1.53 Gbits/sec                  receiver

Field Explanation

Focus on the SUM line, where sender represents the amount of data sent and receiver represents the amount of data received.

Field Note
Interval Test time
Transfer Data transmission volume, divided into sender transmission volume and receiver transmission volume.
Bandwidth Bandwidth, divided into sender sending bandwidth and receiver receiving bandwidth.

Multiple Netperf Instance Startup Script

In TCP-RR and UDP-STREAM, multiple Netperf instances need to be started. The specific number of instances depends on the host configuration. This document introduces a script template for starting multiple Netperf to simplify the testing process. Taking TCP_RR as an example, the script content is as follows:

#!/bin/bash

count=$1
for ((i=1;i<=count;i++))
do
     # Enter the server IP address after -H;
     # -L is followed by the test time. To prevent netperf from ending prematurely, the time is set to 10000;
     # -T is followed by the test mode, you can fill in TCP_RR or TCP_CRR;
     ./netperf -H xxx.xxx.xxx.xxx -l 10000 -t TCP_RR -- -r 1,1 & 
done