You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-network/virtual-network-test-latency.md
+49-48Lines changed: 49 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ manager: Marina Lipshteyn
7
7
ms.service: virtual-network
8
8
ms.topic: how-to
9
9
ms.workload: infrastructure-services
10
-
ms.date: 03/21/2023
10
+
ms.date: 03/23/2023
11
11
ms.author: allensu
12
12
---
13
13
@@ -17,45 +17,51 @@ This article describes how to test network latency between Azure virtual machine
17
17
18
18
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.
19
19
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. Most of 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 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.
21
21
22
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.
23
23
24
-
## Network latency testing process and best practices
24
+
## Network latency test process
25
25
26
26
Latte or SockPerf use the following approach to measure network latency between two physical or virtual computers:
27
27
28
28
1. Create a two-way communications channel between the computers by alternately designating one as sender and one as receiver.
29
29
1. Send and receive packets in both directions and measure the round-trip time (RTT).
30
30
31
-
###Optimal VM configuration
31
+
## Optimal VM configuration for latency
32
32
33
33
To optimize network latency, observe the following recommendations when you create your VMs:
34
34
35
35
- Use the latest version of Windows or Linux.
36
-
- Enable Accelerated Networking for increased performance.
37
-
- Deploy VMs within an [Azure proximity placement group](../virtual-machines/co-location.md).
36
+
- Enable [Accelerated Networking](accelerated-networking-overview.md) for increased performance.
37
+
- Deploy VMs within an [Azure proximity placement group](/azure/virtual-machines/co-location).
38
38
- Create larger VMs for better performance.
39
39
40
-
### Recommended testing process
40
+
### Latency testing best practices
41
41
42
-
Use the following process to test and analyze network latency results:
42
+
Use the following process to test network latency and analyze results:
43
43
44
-
1.Use network latency measurements to establish a benchmark for network latency between deployed VMs. Take a network latency baseline measurement as soon as you complete VM deployment, configuration, and optimizations.
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.
45
45
46
46
1. Test the effect on network latency of any changes to:
47
47
- Operating system (OS) or network stack software, including configuration changes.
48
48
- VM deployment method, such as deploying to an availability zone or proximity placement group (PPG).
49
49
- VM properties, such as Accelerated Networking or size changes.
50
50
- The virtual network, such as routing or filtering changes.
51
51
52
-
1. Always compare new test results to the baseline or to the last test result after controlled changes.
52
+
1. Always compare new test results to the baseline or to the last test results before controlled changes.
53
53
54
54
1. Repeat tests whenever you observe or deploy changes.
55
55
56
56
-
57
57
## Test VMs with Latte or SockPerf
58
58
59
+
Use the following procedures to install and test network latency with [Latte](https://github.com/mellanox/sockperf) for Windows or [SockPerf](https://github.com/mellanox/sockperf) for Linux.
60
+
61
+
# [Windows](#tab/windows)
62
+
63
+
### Install Latte and configure VMs
64
+
59
65
1.[Download the latest version of latte.exe](https://github.com/microsoft/latte/releases/download/v0/latte.exe) into a separate folder on your computer, such as *c:\\tools*.
60
66
61
67
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\\*.
@@ -64,7 +70,9 @@ Use the following process to test and analyze network latency results:
1. Start *latte.exe* from the Windows command line, not from PowerShell. Replace the `<receiver IP address>`, `<port>`, and `<iterations>` placeholders with your own values.
73
+
### Test latency between VMs
74
+
75
+
1. On the receiver VM, start *latte.exe* from the Windows command line, not from PowerShell. Run the following command, replacing the `<receiver IP address>`, `<port>`, and `<iterations>` placeholders with your own values.
68
76
69
77
```cmd
70
78
latte -a <receiver IP address>:<port> -i <iterations>
@@ -75,29 +83,25 @@ Use the following process to test and analyze network latency results:
75
83
76
84
For a VM with an IP address of `10.0.0.4`, the command might look like:<br><br>`latte -a 10.0.0.4:5005 -i 65100`
77
85
78
-
1. On the *sender* VM, start *latte.exe* from the command line. The command is the same as on the receiver, except with `-c` added to indicate that this is the *client*, or sender.
86
+
1. On the *sender* VM, start *latte.exe* from the command line. Run the same command as on the receiver, except with `-c` added to indicate that this is the *client*, or sender. Again replace the `<receiver IP address>`, `<port>`, and `<iterations>` placeholders with your own values.
79
87
80
88
```cmd
81
89
latte -c -a <receiver IP address>:<port> -i <iterations>
82
90
```
83
91
84
-
Again replace the `<receiver IP address>`, `<port>`, and `<iterations>` placeholders with your own values, for example:
92
+
For example:
85
93
86
94
`latte -c -a 10.0.0.4:5005 -i 65100`
87
95
88
96
1. Wait for the results. Depending on how far apart the VMs are, the test could take a few minutes to finish. Consider starting with fewer iterations to test for success before running longer tests.
89
97
90
-
## Test VMs that are running Linux
91
-
92
-
To test VMs that are running Linux, use [SockPerf](https://github.com/mellanox/sockperf).
98
+
# [Linux](#tab/linux)
93
99
94
-
### Install SockPerf on the VMs
100
+
### Prepare VMs
95
101
96
-
On the Linux VMs, both *sender* and *receiver*, run the following commands to prepare SockPerf on the VMs. Commands are provided for the major distros.
102
+
On both the *sender* and *receiver* Linux VMs, run the following commands to prepare SockPerf on the VMs, depending on your Linux distro.
97
103
98
-
#### For Red Hat Enterprise Linux (RHEL)/CentOS
99
-
100
-
Run the following commands:
104
+
# [Red Hat Enterprise Linux (RHEL) / CentOS](#tab/linux/rhel)
101
105
102
106
```bash
103
107
#RHEL/CentOS - Install Git and other helpful tools
@@ -110,9 +114,7 @@ Run the following commands:
110
114
sudo yum install -y libtool
111
115
```
112
116
113
-
#### For Ubuntu
114
-
115
-
Run the following commands:
117
+
# [Ubuntu](#tab/linux/ubuntu)
116
118
117
119
```bash
118
120
#Ubuntu - Install Git and other helpful tools
@@ -125,8 +127,9 @@ Run the following commands:
125
127
sudo apt update
126
128
sudo apt upgrade
127
129
```
130
+
---
128
131
129
-
#### For all distros
132
+
###Copy, compile, and install SockPerf
130
133
131
134
Copy, compile, and install SockPerf according to the following steps:
132
135
@@ -139,7 +142,7 @@ cd sockperf/
139
142
./autogen.sh
140
143
./configure --prefix=
141
144
142
-
#make is slower, may take several minutes
145
+
#make is slow, may take several minutes
143
146
make
144
147
145
148
#make install is fast
@@ -148,33 +151,31 @@ sudo make install
148
151
149
152
### Run SockPerf on the VMs
150
153
151
-
After the SockPerf installation is complete, the VMs are ready to run the latency tests.
152
-
153
-
First, start SockPerf on the *receiver*.
154
-
155
-
Any available port number is fine. In this example, we use port 12345:
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.
156
155
157
-
```bash
158
-
#Server/Receiver - assumes server's IP is 10.0.0.4:
159
-
sudo sockperf sr --tcp -i 10.0.0.4 -p 12345
160
-
```
156
+
```bash
157
+
#Server/Receiver for IP 10.0.0.4:
158
+
sudo sockperf sr --tcp -i 10.0.0.4 -p 12345
159
+
```
161
160
162
-
Now that the server is listening, the client can begin sending packets to the server on the port on which it is listening (in this case, 12345).
161
+
1.Now that the server is listening, on the *sender* or client computer, start sending packets to the server on the listening port, in this case`12345`.
163
162
164
-
About 100 seconds is long enough to return representative results, as shown in the following example:
163
+
- The `-t` option sets testing time in seconds. About 100 seconds is long enough to return representative results.
164
+
- The `-m` denotes message size in bytes. A 350-byte message size is typical for an average packet. You can adjust the size higher or lower to more accurately represent your VM's workloads.
Wait for the results. Depending on how far apart the VMs are, the number of iterations will vary. To test for success before you run longer tests, consider starting with shorter tests of about 5 seconds.
This SockPerf example uses a 350-byte message size, which is typical for an average packet. You can adjust the size higher or lower to achieve results that more accurately represent the workload that's running on your VMs.
171
+
1. Wait for the results. Depending on how far apart the VMs are, the number of iterations varies. To test for success before you run longer tests, consider starting with shorter tests of about 5 seconds.
174
172
173
+
---
175
174
176
175
## Next steps
177
-
* Improve latency with an [Azure proximity placement group](../virtual-machines/co-location.md).
178
-
* Learn how to [Optimize networking for VMs](../virtual-network/virtual-network-optimize-network-bandwidth.md) for your scenario.
179
-
* Read about [how bandwidth is allocated to virtual machines](../virtual-network/virtual-machine-network-throughput.md).
180
-
* For more information, see [Azure Virtual Network FAQ](../virtual-network/virtual-networks-faq.md).
176
+
177
+
- Reduce latency with an [Azure proximity placement group](/azure/virtual-machines/co-location).
178
+
-[Optimize network throughput for Azure virtual machines](virtual-network-optimize-network-bandwidth.md).
0 commit comments