This article describes how to use the free NTTTCP tool from Microsoft to test network bandwidth and throughput performance on Azure Windows or Linux virtual machines (VMs). A tool like NTTTCP targets the network for testing and minimizes the use of other resources that could affect performance.
To test throughput, you need two VMs of the same size to function as sender and receiver. The two VMs should be in the same proximity placement group or availability set, so you can use their internal IP addresses and exclude load balancers from the test.
Note the number of VM cores and the receiver VM IP address to use in the commands. Both the sender and receiver commands use the receiver's IP address.
Note
Testing by using a virtual IP is possible, but is beyond the scope of this article.
Examples used in this article
Setting
Value
Receiver VM IP address
10.0.0.5
Number of VM cores
2
Test throughput with Windows VMs or Linux VMs
You can test throughput from Windows VMs by using NTTTCP or from Linux VMs by using NTTTCP-for-Linux.
Open the Windows command line and navigate to the folder where you downloaded ntttcp.exe.
On the receiver VM, create a Windows Firewall allow rule to allow the NTTTCP traffic to arrive. It's easier to allow nttcp.exe by name than to allow specific inbound TCP ports. Run the following command, replacing c:\tools with your download path for ntttcp.exe if different.
To confirm your configuration, use the following commands to test a single Transfer Control Protocol (TCP) stream for 10 seconds on the receiver and sender virtual machines:
Receiver VM
ntttcp -r -m [<number of VM cores> x 2],*,<receiver IP address> -t 10 -P 1
Windows Command Prompt
ntttcp -r -m 4,*,10.0.0.5 -t 10 -P 1
Sender VM
ntttcp -s -m [<number of VM cores> x 2],*,<receiver IP address> -t 10 -P 1
Windows Command Prompt
ntttcp -s -m 4,*,10.0.0.5 -t 10 -P 1
Note
Use the preceding commands only to test configuration.
Tip
When you run the test for the first time to verify setup, use a short test duration to get quick feedback. Once you verify the tool is working, extend the test duration to 300 seconds for the most accurate results.
Run throughput tests
Run the test for 300 seconds, or five minutes, on both the sender and receiver VMs. The sender and receiver must specify the same test duration for the -t parameter.
On the receiver VM, run the following command, replacing the <number of VM cores>, and <receiver IP address> placeholders with your own values.
ntttcp -r -m [<number of VM cores> x 2],*,<receiver IP address> -t 300
Windows Command Prompt
ntttcp -r -m 4,*,10.0.0.5 -t 300
On the sender VM, run the following command. The sender and receiver commands differ only in the -s or -r parameter that designates the sender or receiver VM.
ntttcp -s -m [<number of VM cores> x 2],*,<receiver IP address> -t 300
Windows Command Prompt
ntttcp -s -m 4,*,10.0.0.5 -t 300
Wait for the results.
When the test is complete, the output should be similar as the following example:
git clone https://github.com/Microsoft/ntttcp-for-linux
cd ntttcp-for-linux/src
sudo make && sudo make install
Run throughput tests
Run the NTTTCP test for 300 seconds, or five minutes, on both the sender VM and the receiver VM. The sender and receiver must specify the same test duration for the -t parameter. Test duration defaults to 60 seconds if you don't specify a time parameter.
On the receiver VM, run the following command:
Bash
ntttcp -r -m 4,*,10.0.0.5 -t 300
On the sender VM, run the following command. This example shows a sender command for a receiver IP address of 10.0.0.5.
Bash
ntttcp -s -m 4,*,10.0.0.5 -t 300
When the test is complete, the output should be similar as the following example:
Output
azureuser@vm-3:~/ntttcp-for-linux/src$ ntttcp -s -m 4,*,10.0.0.5 -t 300
NTTTCP for Linux 1.4.0
---------------------------------------------------------
23:59:01 INFO: 4 threads created
23:59:01 INFO: 4 connections created in 1933 microseconds
23:59:01 INFO: Network activity progressing...
00:04:01 INFO: Test run completed.
00:04:01 INFO: Test cycle finished.
00:04:01 INFO: 4 connections tested
00:04:01 INFO: ##### Totals: #####
00:04:01 INFO: test duration:300.00 seconds
00:04:01 INFO: total bytes:35750674432
00:04:01 INFO: throughput:953.35Mbps
00:04:01 INFO: retrans segs:13889
00:04:01 INFO: cpu cores:2
00:04:01 INFO: cpu speed:2793.437MHz
00:04:01 INFO: user:0.16%
00:04:01 INFO: system:1.60%
00:04:01 INFO: idle:98.07%
00:04:01 INFO: iowait:0.05%
00:04:01 INFO: softirq:0.12%
00:04:01 INFO: cycles/byte:0.91
00:04:01 INFO: cpu busy (all):3.96%
---------------------------------------------------------
Test throughput between a Windows VM and a Linux VM
To run NTTTCP throughput tests between a Windows VM and a Linux VM, enable no-sync mode by using the -ns flag on Windows or the -N flag on Linux.
Azure HPC is a purpose-built cloud capability for HPC & AI workload, using leading-edge processors and HPC-class InfiniBand interconnect, to deliver the best application performance, scalability, and value. Azure HPC enables users to unlock innovation, productivity, and business agility, through a highly available range of HPC & AI technologies that can be dynamically allocated as your business and technical needs change. This learning path is a series of modules that help you get started on Azure HPC - you