- Documentation
Elastic Compute Service
Elastic Compute Service
Best Practices
Performance test
Network performance test
Using iPerf3 to test network performance
Network performance test
Using iPerf3 to test network performance
Using iPerf3 to test network performance
This topic describes how to use iPerf3 to test ECS instance network performance.
iPerf3 overview
iPerf3 is a tool for testing the maximum available bandwidth on IP networks. It allows you to adjust parameters related to timing, buffers, and protocols (TCP, UDP, SCTP, IPv4, and IPv6). It offers detailed test reports on network bandwidth, delay jitter, and packet loss rate.
Procedure
tip
Test results provided in this topic are for reference only and do not represent the actual optimal performance of an ECS instance.
Step 1: Prepare the environment
Refer to the practice of purchasing an ECS instance to create the DUT and Testers. The test environment provided in this topic is shown in the table below: tip
All ECS instances need to be associated with the same security group.
Step 2: Install iperf3
- On the DUT and the Testers, execute the following commands to install iperf3.
Step 3: Test network performance
Inbound direction test
- On the DUT, start 128 iperf3 server processes.
- Distribute 128 iperf3 servers evenly to four Testers. On each Tester, start 32 iperf3 server processes.
- On the DUT (172.0.0.1), create the script server.sh, and then grant execution permission.
- Execute the vim server.sh command to create the server.sh file.
- Press i to enter the edit mode.
- In the server.sh file, enter the following content.
- Press Esc to exit the edit mode, input :wq and press Enter.
- Execute the chmod +x server.sh command to grant execution permission to the server.sh file.
- On the DUT (172.0.0.1), run ./ server.sh 128 to start 128 iperf3 server processes.
- On each Tester, create the script client.sh, and then grant execution permission.
- Execute the vim client.sh command to create the client.sh file.
- Press i to enter the edit mode.
- In the client.sh file, enter the following content.
tip
Specify the values of parameter port_begin of the four Testers incrementally. For example:
172.0.0.2: 12000
172.0.0.3: 12032
172.0.0.4: 12064
172.0.0.5: 12096
- Press Esc to exit the edit mode, input :wq and press Enter.
- Execute the chmod +x client.sh command to grant execute permission to the client.sh file.
- On each Tester, execute the ./client.sh 172.0.0.1 32 command to start 32 iperf3 client processes.
- On the DUT, execute the sar -n DEV 1 command to view the test results.
-
Outbound direction test
- Distribute 128 ports evenly to four Testers. On each Tester, start 32 iperf client processes.
- The DUT (172.0.0.1) starts 32 iperf3 client processes to each Tester (172.0.0.2 to 172.0.0.5) to generate traffic, resulting in 128 iperf3 client processes in total.
- On each Tester, create the script server.sh, and then grant execution permission.
- Execute the vim server.sh command to create the server.sh file.
- Press i to enter the edit mode.
- In the server.sh file, enter the following content.
tip
Specify the values of parameter port_begin of the four Testers incrementally. For example:
172.0.0.2: 12000
172.0.0.3: 12032
172.0.0.4: 12064
172.0.0.5: 12096
- Press Esc to exit the edit mode, input :wq and press Enter.
- Execute the chmod +x server.sh command to grant execution permission to the server.sh file.
- Execute ./server.sh 32 on the Testers to start 32 iperf3 server processes.
- On the DUT (172.0.0.1), create the script client.sh, and then grant execution permission.
- Execute the vim client.sh command to create the client.sh file.
- Press i to enter the edit mode.
- In the client.sh file, enter the following content.
- Press Esc to exit the edit mode, input :wq and press Enter.
- Execute the chmod +x client.sh command to grant execute permission to the client.sh file.
- On the DUT (172.0.0.1), execute the following commands to run the client.sh script file.
- Execute the sar -n DEV 1 command on each Tester and view the test results.
- Then, sum up the results obtained in the four Testers to obtain the test result for DUT. For example: 3790019 + 3183582 + 3500913 + 3564047, which adds up to about 14 Mpps.
-
Last updated: 2026.10.19 19:42:20