Test network performance

Last Updated: Jul 17, 2017

This article explains how to test the network performance of an ECS instance. The article covers:

  1. Prepare the environment, including:
    1.1. Prepare the testing server
    1.2. Prepare the companion training servers
    1.3. Install Netperf
    1.4. Enable the multiple queues feature
  2. Test, including:
    2.1. Introduce tool-related parameters
    2.2. Test inbound traffic
    2.3. Test outbound traffic
    2.4. Analyze test results

1. Prepare the environment

To complete the test, you have to prepare:

  • A testing server: The ECS instance that will be stress tested to determine its Packets per Second (PPS) performance. The server can be used as the client or server in the Netperf test.

  • Eight companion training server: Eight ECS instances used as clients or servers in the Netperf test. They establish control connections with the testing servers to pass testing configuration information and test results.

All ECS instances must be in the same security group.

1.1. Prepare the testing server

  • Image: centos_7_2_64_40G_base_20170222.vhd
  • Instance type: ecs.se1.14xlarge
  • Quantity: 1
  • ECS instance name: i-test-vm (hypothetically)

Suppose the IP address of the testing server is 172.0.0.1.

1.2. Prepare eight companion training servers

  • Image: centos_7_2_64_40G_base_20170222.vhd
  • Instance type: ecs.se1.2xlarge
  • Quantity: 8
  • ECS instance names: i-partnerVm-{1-8}

Suppose IP addresses of the eight testing servers are: 172.0.0.2−172.0.0.9.

1.3. Install Netperf

Install Netperf on the testing server and companion training servers following the steps.

  1. Run the following command to download Netperf.

    1. wget -c "https://codeload.github.com/HewlettPackard/netperf/tar.gz/netperf-2.5.0" -O netperf-2.5.0.tar.gz
  2. Run the following command to install Netperf.

    1. tar -zxvf netperf-2.5.0.tar.gz
    2. cd netperf-netperf-2.5.0
    3. ./configure && make && make install && cd ..
  3. Run netperf -h and netserver -h to verify whether the installation was successful.

1.4. Enable the multiple queues feature

Run the following commands on the testing server (we suppose the eth0 NIC will be enabled) to enable the multiple queues feature.

  1. ethtool -L eth0 combined 4
  2. echo "ff" > /sys/class/net/eth0/queues/rx-0/rps_cpus
  3. echo "ff" > /sys/class/net/eth0/queues/rx-1/rps_cpus
  4. echo "ff" > /sys/class/net/eth0/queues/rx-2/rps_cpus
  5. echo "ff" > /sys/class/net/eth0/queues/rx-3/rps_cpus

2. Test

2.1. Introduce Netperf parameters

After Netperf is installed, two tools will be generated: netserver and netperf. The main parameters for the two programs are listed in the table.

Tool name Role in Netperf Main parameters Parameter description
netserver Server -p Port
netperf Client -H Specify the IP address of an ECS instance.
-p Specify the port of an ECS instance.
-l Specify the running time.
-t Specify the protocol and type of bulk data transfer performance: TCP_STREAM or UDP_STREAM. UDP_STREAM is recommended.
-m Specify the size of a data packet.
  • Set to 1 for testing PPS performance.
  • Set to 1400 for testing bit per second (bps) performance.

2.2. Test inbound traffic

  1. Start the netserver process on the testing server and use -p to specify different ports:

    1. netserver -p 11256
    2. netserver -p 11257
    3. netserver -p 11258
    4. netserver -p 11259
    5. netserver -p 11260
    6. netserver -p 11261
    7. netserver -p 11262
    8. netserver -p 11263
  2. Start the netperf process on the companion training servers and specify the netserver ports of the testing server to different companion training servers for data connection.

    1. netperf -H 172.0.0.1 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 1
    2. netperf -H 172.0.0.1 -p 11257 -t UDP_STREAM -l 300 -- -m 1 #Server 2
    3. netperf -H 172.0.0.1 -p 11258 -t UDP_STREAM -l 300 -- -m 1 #Server 3
    4. netperf -H 172.0.0.1 -p 11259 -t UDP_STREAM -l 300 -- -m 1 #Server 4
    5. netperf -H 172.0.0.1 -p 11260 -t UDP_STREAM -l 300 -- -m 1 #Server 5
    6. netperf -H 172.0.0.1 -p 11261 -t UDP_STREAM -l 300 -- -m 1 #Server 6
    7. netperf -H 172.0.0.1 -p 11262 -t UDP_STREAM -l 300 -- -m 1 #Server 7
    8. netperf -H 172.0.0.1 -p 11263 -t UDP_STREAM -l 300 -- -m 1 #Server 8

    If you want to test the bps performance, the preceded commands must be changed to:

    1. netperf -H 172.0.0.1 -p 11256 -t UDP_STREAM -l 300 -- -m 1400 #Server 1
    2. netperf -H 172.0.0.1 -p 11257 -t UDP_STREAM -l 300 -- -m 1400 #Server 2
    3. netperf -H 172.0.0.1 -p 11258 -t UDP_STREAM -l 300 -- -m 1400 #Server 3
    4. netperf -H 172.0.0.1 -p 11259 -t UDP_STREAM -l 300 -- -m 1400 #Server 4
    5. netperf -H 172.0.0.1 -p 11260 -t UDP_STREAM -l 300 -- -m 1400 #Server 5
    6. netperf -H 172.0.0.1 -p 11261 -t UDP_STREAM -l 300 -- -m 1400 #Server 6
    7. netperf -H 172.0.0.1 -p 11262 -t UDP_STREAM -l 300 -- -m 1400 #Server 7
    8. netperf -H 172.0.0.1 -p 11263 -t UDP_STREAM -l 300 -- -m 1400 #Server 8

2.3. Test outbound traffic

  1. Start the netserver process on all the companion training servers and use -p to specify a port on all eight servers:

    1. netserver -p 11256
  2. Start eight netperf processes on the testing server and use -H to specify the IP addresses of all eight companion training servers for data connection.

    1. netperf -H 172.0.0.2 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 1
    2. netperf -H 172.0.0.3 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 2
    3. netperf -H 172.0.0.4 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 3
    4. netperf -H 172.0.0.5 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 4
    5. netperf -H 172.0.0.6 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 5
    6. netperf -H 172.0.0.7 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 6
    7. netperf -H 172.0.0.8 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 7
    8. netperf -H 172.0.0.9 -p 11256 -t UDP_STREAM -l 300 -- -m 1 #Server 8

    If you want to test the bps performance, the preceded commands must be changed to:

    1. netperf -H 172.0.0.1 -p 11256 -t UDP_STREAM -l 300 -- -m 1400 #Server 1
    2. netperf -H 172.0.0.1 -p 11257 -t UDP_STREAM -l 300 -- -m 1400 #Server 2
    3. netperf -H 172.0.0.1 -p 11258 -t UDP_STREAM -l 300 -- -m 1400 #Server 3
    4. netperf -H 172.0.0.1 -p 11259 -t UDP_STREAM -l 300 -- -m 1400 #Server 4
    5. netperf -H 172.0.0.1 -p 11260 -t UDP_STREAM -l 300 -- -m 1400 #Server 5
    6. netperf -H 172.0.0.1 -p 11261 -t UDP_STREAM -l 300 -- -m 1400 #Server 6
    7. netperf -H 172.0.0.1 -p 11262 -t UDP_STREAM -l 300 -- -m 1400 #Server 7
    8. netperf -H 172.0.0.1 -p 11263 -t UDP_STREAM -l 300 -- -m 1400 #Server 8

2.4. Analyze test results

Each netperf process on the client outputs the following results.

  1. Socket Message Elapsed Messages
  2. Size Size Time Okay Errors Throughput
  3. bytes bytes secs # # 10^6bits/sec
  4. 124928 1 10.00 4532554 0 3.63
  5. 212992 10.00 1099999 0.88

The fields in the result is explained in the following table.

Field data Meaning
124928 Socket size (Byte)
1 Data packet size (Byte)
10.00 Testing time (second)
4532554 Successful data packets
0 Failed data packets
3.63 Network throughput (Mbit/s)

PPS = Successful data packets/testing time

We recommend that you run sar on the server to calculate the packets actually received and use it as the result. The specific command is:sar -n DEV 1 320.

Thank you! We've received your feedback.