Closed2

iperf3によるノード間の速度計測

bilzardbilzard

概要

iperf3[1]でノード間の通信速度を計測する手順について記述する。

Install

Ubuntu 20.04

aptで入るのは3.7なのでやや古い。より新しいバージョン(3.9)をインストールするには[2]に従う。

$ sudo apt remove iperf3 libiperf0
$ sudo apt install libsctp1
$ wget https://iperf.fr/download/ubuntu/libiperf0_3.9-1_amd64.deb
$ wget https://iperf.fr/download/ubuntu/iperf3_3.9-1_amd64.deb
$ sudo dpkg -i libiperf0_3.9-1_amd64.deb iperf3_3.9-1_amd64.deb
$ rm libiperf0_3.9-1_amd64.deb iperf3_3.9-1_amd64.deb

Ubuntu 22.04

$ sudo apt install iperf3

Mac (brew)

$ brew install iperf3

速度計測

server

サーバ側は7001ポートを解放する必要があるが、解放したくない場合はSSH port forwardingを利用できる(後述)。

iperfのサーバを起動。

$ iperf3 -s -p 7001

client

client -> serverに対してSSHローカルポートフォワードする。

$ ssh -L 7001:localhost:7001 (serverのホスト名)

別のターミナルからiperf3のクライアントを起動

$ iperf3 -c localhost -p 7001
Connecting to host localhost, port 7001
[  7] local ::1 port 63802 connected to ::1 port 7001
[ ID] Interval           Transfer     Bitrate
[  7]   0.00-1.00   sec  30.0 MBytes   251 Mbits/sec
[  7]   1.00-2.00   sec  24.1 MBytes   202 Mbits/sec
[  7]   2.00-3.00   sec  17.6 MBytes   148 Mbits/sec
[  7]   3.00-4.00   sec  7.84 MBytes  66.0 Mbits/sec
[  7]   4.00-5.00   sec  15.2 MBytes   127 Mbits/sec
[  7]   5.00-6.00   sec  9.52 MBytes  80.1 Mbits/sec
[  7]   6.00-7.00   sec  12.9 MBytes   108 Mbits/sec
[  7]   7.00-8.00   sec  12.0 MBytes   101 Mbits/sec
[  7]   8.00-9.00   sec  11.5 MBytes  96.3 Mbits/sec
[  7]   9.00-10.00  sec  11.2 MBytes  94.1 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  7]   0.00-10.00  sec   152 MBytes   127 Mbits/sec                  sender
[  7]   0.00-10.02  sec   149 MBytes   125 Mbits/sec                  receiver

iperf Done.

Reference

bilzardbilzard

上記の計測結果ではserverは上り・下り共に100Mbpsの契約なので妥当な結果と言える。

このスクラップは2023/11/10にクローズされました