iperf でネットワーク帯域幅を測定する2013/07/23 |
|
iperf を使うとネットワークの帯域幅を測定することができます。
クライアント(送信側)とサーバー(受信側)の2台のマシンを使って計測するため、2台必要になります。 |
|
| [1] | iperf3 インストール (クライアントとサーバー両方にインストール) |
|
[root@dlp ~]# yum --enablerepo=epel -y install iperf3 # EPELからインストール
|
| [2] | サーバー(受信側)で以下のようにコマンド実行し待ち受けます。 待ち受けポートを指定する場合は、以下のコマンドに続けて「-p (ポート番号)」を指定してください。 指定しない場合のデフォルトは「5201」です。 |
|
[root@dlp ~]# iperf3 -s ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- |
| [3] | クライアント(送信側)から以下のようにコマンド実行して、帯域幅を測定します。 以下では、10秒間で 860 MBytes を送受信し、721Mbps の速度であったことが分かります。 |
|
# iperf3 -c (クライアントのホスト名またはIPアドレス) [root@dlp ~]# iperf3 -c 10.0.0.253
Connecting to host 10.0.0.253, port 5201
[ 4] local 10.0.0.31 port 53389 connected to 10.0.0.253 port 5201
[ ID] Interval Transfer Bandwidth Retransmits
[ 4] 0.00-10.01 sec 860 MBytes 721 Mbits/sec 223
[ ID] Interval Transfer Bandwidth Retransmits
Sent
[ 4] 0.00-10.01 sec 860 MBytes 721 Mbits/sec 223
Received
[ 4] 0.00-10.01 sec 860 MBytes 721 Mbits/sec
iperf Done.
|
| [4] | 基本的な使い方は上記のとおりですが、 他にもいろいろなオプションがあり、例えば、UDPの帯域幅の測定等も可能であったり、 iperf3 の新機能である JSONフォーマットでの出力も可能です。 いろいろ試してみてください。 |
|
[root@dlp ~]# iperf3 --help
Usage: iperf [-s|-c host] [options]
iperf [-h|--help] [-v|--version]
Server or Client:
-p, --port # server port to listen on/connect to
-f, --format [kmgKMG] format to report: Kbits, Mbits, KBytes, MBytes
-i, --interval # seconds between periodic bandwidth reports
-V, --verbose more detailed output
-J, --json output in JSON format
-d, --debug debug mode
-v, --version show version information and quit
-h, --help show this message and quit
Server specific:
-s, --server run in server mode
Client specific:
-c, --client <host> run in client mode, connecting to <host>
-u, --udp use UDP rather than TCP
-b, --bandwidth #[KMG] for UDP, bandwidth to send at in bits/sec
(default 1 Mbit/sec)
-t, --time # time in seconds to transmit for (default 10 secs)
-n, --num #[KMG] number of bytes to transmit (instead of -t)
-l, --len #[KMG] length of buffer to read or write
(default 128 KB for TCP, 8 KB for UDP)
-P, --parallel # number of parallel client streams to run
-R, --reverse run in reverse mode (server sends, client receives)
-w, --window #[KMG] TCP window size (socket buffer size)
-B, --bind <host> bind to a specific interface or multicast address
-M, --set-mss # set TCP maximum segment size (MTU - 40 bytes)
-N, --nodelay set TCP no delay, disabling Nagle's Algorithm
-6, --version6 use IPv6
-S, --tos N set the IP 'type of service'
-Z, --zerocopy use a 'zero copy' method of sending data
[KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga-
|
| Sponsored Link |
|
|