- Documentation
Elastic Compute Service
Elastic Compute Service
Best Practices
Performance test
Network performance test
Using Netperf to test network performance
Network performance test
Using Netperf to test network performance
Using Netperf to test network performance
This topic describes how to use Netperf to test ECS instance network performance.
Netperf overview
Netperf is a tool for testing network performance (mainly for TCP- or UDP-based data transmission). It supports different modes (bulk data transfer mode and request/response mode) in testing network performance based on the application. Netperf test results mainly indicate the speed at which one system sends data to another and the speed at which another system receives data. For more information, visit the Netperf official website. Prepare the environment
tip
Test results provided in this topic are for reference only and do not represent the actual optimal performance of an ECS instance.
During testing, refer to Purchasing an instance by following the wizard to purchase two Linux-based ECS instances with the same configurations. For ECS instance A, install Netperf netserver to serve as the server side. For ECS instance B, install Netperf to serve as the client side. Make sure that no other applications are running on both ECS instances during the test. Then, use ECS instance B to stress-test ECS instance A (no packet size specified) for the TCP inbound bandwidth performance of ECS instance A. The network stress test lasts for 5 minutes. For ECS instance A, you can calculate the average bandwidth by using data collected from the 50th second to the 250th second of the test. ECS instance planning is as follows:
Install Netperf
- On both ECS instances, execute the following commands to install Netperf.
- Execute the following command to verify the installation result. If help information is returned, Netperf is installed.
Test network performance
Test TCP BPS
- On the server side, start the netserver process to listen on port 12000.
- On the client side, execute the following command. The IP address in the command is the private IP address of the server instance.
- netperf -H 192.168.xx.xx -p 12000 -t TCP_STREAM -l 300 -- -m 1440 &
- On the server side, use sar to view the test results.
-
- The test results of bps are values of rxkB/s. Unit conversion: kB/s * 8 / 1000 = Mbps.
Test TCP CPS
- On the server side, start the netserver process to listen on port 12000.
- On the client side, execute the following command. The IP address in the command is the private IP address of the server instance.
- netperf -H 192.168.xx.xx -p 12000 -t TCP_CRR -l 300 &
- On the server side, use sar to view the test results.
-
- The test results of CPS are the values of rxpck/s divided by 5.
Test UDP PPS
- On the server side, start the netserver process to listen on port 12000.
- On the client side, execute the following command. The IP address in the command is the private IP address of the server instance.
- netperf -H 192.168.xx.xx -p 12000 -t UDP_STREAM -l 300 -- -m 1 &
- On the server side, use sar to view the test results.
-
- The test results of pps are values of rxpck/s.
Appendix
Optimize the performance of TCP CPS
On 3rd-generation instances, TCP CPS performance is affected by multiple factors. To optimize your ECS instance configurations for optimal TCP CPS performance, refer to the instructions below.
- Disable XPS for eth0 (applicable only to 3rd-generation instances)
- On both instances, execute the following commands in sequence to disable XPS for eth0.
- This topic uses ecs.g3a.8xlarge (32C) as an example, as displayed below.
-
- Interrupt core binding (applicable only to 3rd-generation AMD instances)
- On both instances, execute the following commands to configure interrupt affinity for eth0.
- Run the core-binding test via Netperf.
- On the server side, start multiple netserver processes for port listening. For example, start 1024 netserver processes.
- On the client side, execute the following command. The IP address in the command is the private network IP address of the server-side instance.
-
-
Last updated: 2026.06.18 17:49:49