Skip to content

Commit 38108ec

Browse files
committed
add throughput article
1 parent a4fe074 commit 38108ec

File tree

2 files changed

+134
-127
lines changed

2 files changed

+134
-127
lines changed
Lines changed: 118 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,187 @@
11
---
2-
title: Testing Azure VM network throughput
3-
titlesuffix: Azure Virtual Network
4-
description: Use NTTTCP to target the network for testing and minimize the use of other resources that could impact performance.
2+
title: Test Azure VM network throughput by using NTTTCP
3+
description: Use the NTTTCP tool to test network bandwidth and throughput performance for Windows and Linux VMs on a virtual network.
54
services: virtual-network
65
author: asudbring
76
ms.service: virtual-network
87
ms.topic: how-to
98
ms.workload: infrastructure-services
10-
ms.date: 10/06/2020
9+
ms.date: 03/23/2023
1110
ms.author: allensu
1211
---
1312

14-
# Bandwidth/Throughput testing (NTTTCP)
13+
# Test network bandwidth or throughput with NTTTCP
1514

16-
When testing network throughput performance in Azure, it's best to use a tool that targets the network for testing and minimizes the use of other resources that could impact performance. NTTTCP is recommended.
15+
This article describes how to use the free NTTTCP tool from Microsoft to test network throughput performance on Azure Windows or Linux virtual machines (VMs). To test network throughput and bandwidth, it's best to use a tool like NTTTCP that targets the network for testing and minimizes the use of other resources that could affect performance.
1716

18-
Copy the tool to two Azure VMs of the same size. One VM functions as SENDER
19-
and the other as RECEIVER.
17+
## Prerequisites
2018

21-
#### Deploying VMs for testing
22-
For the purposes of this test, the two VMs should be in either the same [Proximity Placement Group](../virtual-machines/co-location.md) or the same Availability Set so that we can use their internal IPs and exclude the Load Balancers from the test. It is possible to test with the VIP but this kind of testing is outside the scope of this document.
19+
To test throughput, you need two VMs of the same size to function as *sender* and *receiver*. The two VMs should be in either the same [proximity placement proup](/azure/virtual-machines/co-location) or the same [availability set](/azure/virtual-machines/availability-set-overview), so you can use their internal IP addresses and exclude load balancers from the test.
2320

24-
Make a note of the RECEIVER's IP address. Let's call that IP "a.b.c.r"
21+
Note the number of VM cores and the VM IP addresses to use in the following procedures. Both the sender and receiver commands use the receiver's IP address.
2522

26-
Make a note of the number of cores on the VM. Let's call this "\#num\_cores"
23+
>[!NOTE]
24+
>Testing by using a virtual IP (VIP) is possible, but is beyond the scope of this article.
2725
28-
Run the NTTTCP test for 300 seconds (or 5 minutes) on the sender VM and receiver VM.
26+
## Test throughput for Windows or Linux VMs
2927

30-
Tip: When setting up this test for the first time, you might try a shorter test period to get feedback sooner. Once the tool is working as expected, extend the test period to 300 seconds for the most accurate results.
28+
You can test throughput on Windows or Linux machines.
3129

32-
> [!NOTE]
33-
> The sender **and** receiver must specify **the same** test duration
34-
parameter (-t).
35-
>
36-
> The IP address in both Sender and Receiver commands is the Receiver's IP address.
37-
>
38-
> The -r and -s flags are no longer required for the receiver and sender parameters.
30+
Run the NTTTCP 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. Test duration defaults to 60 seconds if no time parameter is specified.
3931

40-
To test a single TCP stream for 10 seconds:
32+
# [Windows](#tab/windows)
4133

42-
Receiver parameters: ntttcp -r -t 10 -P 1
34+
### Set up NTTTPS and test configuration
4335

44-
Sender parameters: ntttcp -s10.27.33.7 -t 10 -n 1 -P 1
36+
1. On both the sender and receiver VMs, [download the latest version of NTTTCP](https://github.com/microsoft/ntttcp/releases/latest) into a separate folder like *c:\\tools*.
4537

46-
> [!NOTE]
47-
> The preceding sample should only be used to confirm your configuration. Valid examples of testing are covered later in this document.
38+
1. On the receiver VM, create a Windows Defender 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. In the following command, replace the `<path>` placeholder with the path you downloaded *ntttcp.exe* to, such as *c:\\tools\\*.
4839

49-
## Testing VMs running WINDOWS:
40+
```cmd
41+
netsh advfirewall firewall add rule program=<path>ntttcp.exe name="ntttcp" protocol=any dir=in action=allow enable=yes profile=ANY
42+
```
5043

51-
#### Get NTTTCP onto the VMs.
44+
For example, if you copied *ntttcp.exe* to *c:\\tools*, run the following command: 
5245

53-
Download the latest version:
54-
https://github.com/microsoft/ntttcp/releases/latest
46+
`netsh advfirewall firewall add rule program=c:\tools\ntttcp.exe name="ntttcp" protocol=any dir=in action=allow enable=yes profile=ANY`
5547

56-
Consider putting NTTTCP in separate folder, like c:\\tools
48+
1. To confirm your configuration, test a single Transfer Control Protocol (TCP) stream for 10 seconds by running the following commands:
5749

58-
#### Allow NTTTCP through the Windows firewall
59-
On the RECEIVER, create an Allow rule on the Windows Firewall to allow the
60-
NTTTCP traffic to arrive. It's easiest to allow the entire NTTTCP program by
61-
name rather than to allow specific TCP ports inbound.
50+
- On the receiver VM, run `ntttcp -r -t 10 -P 1`.
51+
- On the sender VM, run `ntttcp -s<receiver IP address> -t 10 -n 1 -P 1`.
6252

63-
Allow ntttcp through the Windows Firewall like this:
53+
>[!TIP]
54+
>When you run the test for the first time to verify setup, you use a short test period. Once you verify the tool is working, extend the test period to 300 seconds for the most accurate results.
6455
65-
netsh advfirewall firewall add rule program=\<PATH\>\\ntttcp.exe name="ntttcp" protocol=any dir=in action=allow enable=yes profile=ANY
56+
>[!NOTE]
57+
>Use the preceding commands only to test configuration.
6658
67-
For example, if you copied ntttcp.exe to the "c:\\tools" folder, this would be the command: 
59+
### Run NTTTCP tests
6860

69-
netsh advfirewall firewall add rule program=c:\\tools\\ntttcp.exe name="ntttcp" protocol=any dir=in action=allow enable=yes profile=ANY
61+
1. On the receiver VM, start *ntttcp.exe* from the Windows command line, not from PowerShell. Run the following command, replacing the `<number of VM cores>`, and `<receiver IP address>` placeholders with your own values.
7062

71-
#### Running NTTTCP tests
63+
```cmd
64+
ntttcp -r -m [<number of VM cores> * 2],*,<receiver IP address> -t 300
65+
```
7266

73-
Start NTTTCP on the RECEIVER (**run from CMD**, not from PowerShell):
67+
The command for a VM with four cores and an IP address of `10.0.0.4` looks like the following example:
7468

75-
ntttcp -r -m [2\*\#num\_cores],\*,a.b.c.r -t 300
69+
`ntttcp -r -m 8,*,10.0.0.4 -t 300`
7670

77-
If the VM has four cores and an IP address of 10.0.0.4, it would look like this:
71+
1. On the sender VM, run the following command from a Windows command line. The sender and receiver commands differ only in the `-s` or `-r` parameter that designates the sender or receiver VM.
7872

79-
ntttcp -r -m 8,\*,10.0.0.4 -t 300
73+
```cmd
74+
ntttcp -s -m [<number of VM cores> * 2],*,<receiver IP address> -t 300
75+
```
8076

77+
The following example shows the command if the receiver IP address is `10.0.0.4`:
78+
79+
```cmd
80+
ntttcp -s -m 8,*,10.0.0.4 -t 300 
81+
```
8182

82-
Start NTTTCP on the SENDER (**run from CMD**, not from PowerShell):
83+
1. Wait for the results.
8384

84-
ntttcp -s -m 8,\*,10.0.0.4 -t 300 
85+
# [Linux](#tab/linux)
8586

86-
Wait for the results.
87+
### Prepare VMs and install NTTTPS-for-Linux
8788

89+
To measure throughput from Linux machines, use [NTTTCP-for-Linux](https://github.com/Microsoft/ntttcp-for-linux).
8890

89-
## Testing VMs running LINUX:
91+
1. On both the sender and receiver VMs, run the following commands to prepare NTTTCP-for-Linux on your VMs, depending on your distro:
9092

91-
Use nttcp-for-linux. It is available from <https://github.com/Microsoft/ntttcp-for-linux>
93+
- For **CentOS**, install `gcc` and `git`:
9294

93-
On the Linux VMs (both SENDER and RECEIVER), run these commands to prepare ntttcp-for-linux on your VMs:
95+
``` bash
96+
yum install gcc -y
97+
yum install git -y
98+
```
9499

95-
CentOS - Install gcc and git:
96-
``` bash
97-
  yum install gcc -y
98-
  yum install git -y
99-
```
100-
Ubuntu - Install build-essential and git:
101-
``` bash
102-
 apt-get -y install build-essential
103-
 apt-get -y install git
104-
```
105-
SUSE - Install git-core, gcc, and make:
106-
``` bash
107-
zypper in -y git-core gcc make
108-
```
109-
Make and Install on both:
110-
``` bash
111-
 git clone https://github.com/Microsoft/ntttcp-for-linux
112-
 cd ntttcp-for-linux/src
113-
 make && make install
114-
```
100+
- For **Ubuntu**, install `build-essential` and `git`:
115101

116-
As in the Windows example, we assume the Linux RECEIVER's IP is 10.0.0.4
102+
``` bash
103+
apt-get -y install build-essential
104+
apt-get -y install git
105+
```
117106

118-
Start NTTTCP-for-Linux on the RECEIVER:
107+
- For **SUSE**, install `git-core`, `gcc`, and `make`:
119108

120-
``` bash
121-
ntttcp -r -t 300
122-
```
109+
``` bash
110+
zypper in -y git-core gcc make
111+
```
123112

124-
And on the SENDER, run:
113+
1. Make and install NTTTCP-for-Linux:
125114

126-
``` bash
127-
ntttcp -s10.0.0.4 -t 300
128-
```
129-
 
130-
Test length defaults to 60 seconds if no time parameter is given
115+
``` bash
116+
git clone https://github.com/Microsoft/ntttcp-for-linux
117+
cd ntttcp-for-linux/src
118+
make && make install
119+
```
131120

132-
## Testing between VMs running Windows and LINUX:
121+
### Run NTTTCP tests
133122

134-
On this scenarios we should enable the no-sync mode so the test can run. This is done by using the **-N flag** for Linux, and **-ns flag** for Windows.
123+
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.
135124
136-
#### From Linux to Windows:
125+
1. On the receiver VM, start NTTTCP-for-Linux and run the test for 300 seconds.
137126
138-
Receiver \<Windows>:
127+
``` bash
128+
ntttcp -r -t 300
129+
```
139130
140-
``` bash
141-
ntttcp -r -m <2 x nr cores>,*,<Windows server IP>
142-
```
131+
1. On the sender VM, run NTTTCP-for-Linux for 300 seconds. The command for a receiver VM with an IP address of `10.0.0.4` looks like the following example:
143132
144-
Sender \<Linux> :
133+
``` bash
134+
ntttcp -s10.0.0.4 -t 300
135+
```
145136
146-
``` bash
147-
ntttcp -s -m <2 x nr cores>,*,<Windows server IP> -N -t 300
148-
```
137+
## Test throughput between Windows and Linux VMs
149138
150-
#### From Windows to Linux:
139+
To run NTTTCP throughput tests between a Windows and a Linux VM, enable no-sync mode by using the `-ns` flag on Windows or the `-N` flag on Linux.
151140
152-
Receiver \<Linux>:
141+
1. Install and configure NTTTCP on the Windows VM and NTTTCP-for-Linux on the Linux VM as instructed in the previous section.
153142
154-
``` bash
155-
ntttcp -r -m <2 x nr cores>,*,<Linux server IP>
156-
```
143+
1. Test throughput on both the Windows and the Linux machines, as follows:
144+
145+
From the Windows VM:
157146
158-
Sender \<Windows>:
147+
- Test with the Windows VM as the receiver:
159148
160-
``` bash
161-
ntttcp -s -m <2 x nr cores>,*,<Linux server IP> -ns -t 300
149+
```cmd
150+
ntttcp -r -m [<number of VM cores> * 2],*,<Linux VM IP>
151+
```
152+
- Test with the Windows VM as the sender:
153+
154+
```cmd
155+
ntttcp -s -m [<number of VM cores> * 2],*,<Linux VM IP> -ns -t 300
156+
```
157+
158+
From the Linux VM:
159+
160+
- Test with the Linux VM as the receiver:
161+
162+
```bash
163+
ntttcp -r -m [<number of VM cores> * 2],*,<Windows VM IP>
164+
```
165+
166+
- Test with the Linux VM as the sender:
167+
168+
```bash
169+
ntttcp -s -m [<number of VM cores> * 2],*,<Windows VM IP> -N -t 300
162170
```
163-
## Testing Cloud Service Instances:
164-
You need to add following section into your ServiceDefinition.csdef
171+
172+
## Test Cloud Service instances
173+
174+
Add the following section to *ServiceDefinition.csdef*:
175+
165176
```xml
166177
<Endpoints>
167178
<InternalEndpoint name="Endpoint3" protocol="any" />
168179
</Endpoints>
169180
```
170181
171182
## Next steps
172-
* Depending on results, there may be room to [Optimize network throughput machines](virtual-network-optimize-network-bandwidth.md) for your scenario.
173-
* Read about how [bandwidth is allocated to virtual machines](virtual-machine-network-throughput.md)
174-
* Learn more with [Azure Virtual Network frequently asked questions (FAQ)](virtual-networks-faq.md)
183+
184+
- [Optimize network throughput for Azure virtual machines](virtual-network-optimize-network-bandwidth.md).
185+
- [Virtual machine network bandwidth](virtual-machine-network-throughput.md).
186+
- [Test VM network latency](virtual-network-test-latency.md)
187+
- [Azure Virtual Network frequently asked questions (FAQ)](virtual-networks-faq.md)

articles/virtual-network/virtual-network-test-latency.md

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,35 @@ This article describes how to test network latency between Azure virtual machine
1717

1818
For the most accurate results, you should measure VM network latency with a tool that's designed for the task and excludes other types of latency, such as application latency. Latte and SockPerf provide the most relevant network latency results by focusing on Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) traffic. Most applications use these protocols, and they have the greatest effect on application performance.
1919

20-
Many other common network latency test tools, such as Ping, don't measure the type of network traffic that's used in real workloads. These tools use Internet Control Message Protocol (ICMP), which most applications don't use, and which can be treated differently from application traffic. These test results might not apply to workloads that use TCP and UDP.
20+
Many other common network latency test tools, such as Ping, don't measure TCP or UDP traffic. Tools like Ping use Internet Control Message Protocol (ICMP), which can be treated differently from application traffic. ICMP test results don't directly apply to workloads that use TCP and UDP.
2121

22-
Tools like Latte or SockPerf measure only TCP or UDP payload delivery times. These tools don't measure ICMP or other packet types that aren't used by applications and don't affect application performance.
22+
Latte and SockPerf measure only TCP or UDP payload delivery times. These tools don't measure ICMP or other packet types that applications don't use and that don't affect application performance.
2323

24-
## Network latency test process
25-
26-
Latte or SockPerf use the following approach to measure network latency between two physical or virtual computers:
24+
Latte and SockPerf use the following approach to measure network latency between two physical or virtual computers:
2725

2826
1. Create a two-way communications channel between the computers by designating one as sender and one as receiver.
2927
1. Send and receive packets in both directions and measure the round-trip time (RTT).
3028

31-
## VM configuration for optimum latency
29+
## Tips and best practices for optimizing network latency
3230

33-
To optimize VMs for network latency, observe the following recommendations when you create your VMs:
31+
To optimize VMs for network latency, observe the following recommendations when you create the VMs:
3432

3533
- Use the latest version of Windows or Linux.
3634
- Enable [Accelerated Networking](accelerated-networking-overview.md) for increased performance.
3735
- Deploy VMs within an [Azure proximity placement group](/azure/virtual-machines/co-location).
3836
- Create larger VMs for better performance.
3937

40-
### Latency testing best practices
41-
42-
Use the following process to test network latency and analyze results:
38+
Use the following best practices to test and analyze network latency:
4339

44-
1. As soon as you complete VM deployment, configuration, and optimizations, take baseline measurements to establish a benchmark for network latency between deployed VMs.
40+
1. As soon as you finish deploying, configuring, and optimizing network VMs, take baseline network latency measurements between deployed VMs to establish benchmarks.
4541

46-
1. Test the effect on network latency of any changes to:
42+
1. Test the effects of any of the following changes on network latency:
4743
- Operating system (OS) or network stack software, including configuration changes.
4844
- VM deployment method, such as deploying to an availability zone or proximity placement group (PPG).
4945
- VM properties, such as Accelerated Networking or size changes.
50-
- The virtual network, such as routing or filtering changes.
46+
- Virtual network configuration, such as routing or filtering changes.
5147

52-
1. Always compare new test results to the baseline or to the last test results before controlled changes.
48+
1. Always compare new test results to the baseline or to the lasest test results before the controlled changes.
5349

5450
1. Repeat tests whenever you observe or deploy changes.
5551

@@ -63,7 +59,7 @@ Use the following procedures to install and test network latency with [Latte](ht
6359

6460
1. [Download the latest version of latte.exe](https://github.com/microsoft/latte/releases/download/v0/latte.exe) to both VMs, into a separate folder such as *c:\\tools*.
6561

66-
1. On the *receiver* VM, create a Windows Defender Firewall `allow` rule to allow the Latte traffic to arrive through Windows Defender Firewall. It's easiest to allow the *latte.exe* program by name rather than to allow specific inbound TCP ports. In the command, replace the `<path>` placeholder with the path you downloaded *latte.exe* to, such as *c:\\tools\\*.
62+
1. On the *receiver* VM, create a Windows Defender Firewall `allow` rule to allow the Latte traffic to arrive. It's easier to allow the *latte.exe* program by name than to allow specific inbound TCP ports. In the command, replace the `<path>` placeholder with the path you downloaded *latte.exe* to, such as *c:\\tools\\*.
6763

6864
```cmd
6965
netsh advfirewall firewall add rule program=<path>latte.exe name="Latte" protocol=any dir=in action=allow enable=yes profile=ANY
@@ -98,9 +94,9 @@ Use the following procedures to install and test network latency with [Latte](ht
9894

9995
### Prepare VMs
10096

101-
On both the *sender* and *receiver* Linux VMs, run the following commands to prepare SockPerf on the VMs, depending on your Linux distro.
97+
On both the *sender* and *receiver* Linux VMs, run the following commands to prepare SockPerf, depending on your Linux distro.
10298

103-
# [Red Hat Enterprise Linux (RHEL) / CentOS](#tab/linux/rhel)
99+
#### Red Hat Enterprise Linux (RHEL) or CentOS
104100

105101
```bash
106102
#RHEL/CentOS - Install Git and other helpful tools
@@ -113,7 +109,7 @@ On both the *sender* and *receiver* Linux VMs, run the following commands to pre
113109
sudo yum install -y libtool
114110
```
115111

116-
# [Ubuntu](#tab/linux/ubuntu)
112+
#### Ubuntu
117113

118114
```bash
119115
#Ubuntu - Install Git and other helpful tools
@@ -127,11 +123,9 @@ On both the *sender* and *receiver* Linux VMs, run the following commands to pre
127123
sudo apt upgrade
128124
```
129125

130-
---
131-
132126
### Copy, compile, and install SockPerf
133127

134-
Copy, compile, and install SockPerf according to the following steps:
128+
Copy, compile, and install SockPerf by running the following commands:
135129

136130
```bash
137131
#Bash - all distros
@@ -151,7 +145,7 @@ sudo make install
151145

152146
### Run SockPerf on the VMs
153147

154-
1. After the SockPerf installation is complete, start SockPerf on the *receiver* VM. Any available port number is fine. The following example uses port `12345`. Replace the example IP address `10.0.0.4` with your own value.
148+
1. After the SockPerf installation is complete, start SockPerf on the *receiver* VM. Any available port number is fine. The following example uses port `12345`. Replace the example IP address `10.0.0.4` with the IP address of your receiver VM.
155149

156150
```bash
157151
#Server/Receiver for IP 10.0.0.4:

0 commit comments

Comments
 (0)