Nota
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
本文介绍如何使用 Microsoft 提供的免费 NTTTCP 工具在 Azure Windows 或 Linux 虚拟机 (VM) 上测试网络带宽和吞吐量性能。 NTTTCP 等工具以网络为目标进行测试,可最大程度地减少可能影响性能的其他资源的使用。
- 具有活动订阅的 Azure 帐户。 创建帐户。
- Azure 中的两台 Windows 或 Linux 虚拟机。 创建 Windows VM 或创建 Linux VM。
Nota
可以使用虚拟 IP 进行测试,但这超出了本文的范围。
本文中使用的示例
设置 | “值” |
---|---|
接收方 VM IP 地址 | 10.0.0.5 |
VM 核心数 | 2 |
可以使用 NTTTCP 测试 Windows VM 的吞吐量,或者使用 NTTTCP-for-Linux 测试 Linux VM 的吞吐量。
若要衡量 Linux 计算机的吞吐量,请使用 NTTTCP-for-Linux。
运行以下命令(具体取决于发行版),为 NTTTCP-for-Linux 准备发送方和接收方 VM:
对于 Ubuntu,安装
build-essential
和git
。sudo apt-get update sudo apt-get -y install build-essential sudo apt-get -y install git
对于 SUSE,请安装
git-core
、gcc
和make
。sudo zypper in -y git-core gcc make
生成并安装 NTTTCP-for-Linux。
git clone https://github.com/Microsoft/ntttcp-for-linux cd ntttcp-for-linux/src sudo make && sudo make install
在发送方 VM 和接收方 VM 上运行 NTTTCP 测试 300 秒(5 分钟)。 发送方和接收方必须为 -t
参数指定相同的测试持续时间。 如果未指定时间参数,则测试持续时间默认为 60 秒。
在接收方 VM 上,运行以下命令:
ntttcp -r -m 4,*,10.0.0.5 -t 300
在发送方 VM 上,运行以下命令。 此示例演示了 IP 地址为
10.0.0.5
的接收方的发送方命令。ntttcp -s -m 4,*,10.0.0.5 -t 300
测试完成后,输出应类似于以下示例:
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%
---------------------------------------------------------
若要在 Windows VM 和 Linux VM 之间运行 NTTTCP 吞吐量测试,请在 Windows 上使用 -ns
标志或在 Linux 上使用 -N
标志来启用不同步模式。
若要使用 Linux VM 作为接收方进行测试,请运行以下命令:
ntttcp -r -m [<number of VM cores> x 2],*,<Windows VM IP address> -t 300
若要使用 Linux VM 作为发送方进行测试,请运行以下命令:
ntttcp -s -m [<number of VM cores> x 2],*,<Windows VM IP address> -N -t 300