この記事は1年以上前に書かれたものです。
情報が古い可能性があります。
ESXi でネットワークのパフォーマンスを調べてみたかったので使ってみた。
ハイパーバイザー: VMware ESXi, 7.0.2
[2023/04/16 追記]
ESXi 7.0.x (2までは動いてた)から root 権限が変更され実行できなくなったようです。ESXi 8 についても同様。今のところ回避策は見つからず。The root account can no longer change permissions or executable files in ESXi 7.0.x (78689) (vmware.com)
[root@esxi-host01:~] /usr/lib/vmware/vsan/bin/iperf3 にあるが、そのままだとエラーになる。
[root@esxi-host01:~] /usr/lib/vmware/vsan/bin/iperf3 -s
iperf3: error - unable to start listener for connections: Operation not permitted
iperf3: exiting
しょうがないのでコピーして使う。
[root@esxi-host01:~] cp /usr/lib/vmware/vsan/bin/iperf3 /usr/lib/vmware/vsan/bin/iperf3.copy
ファイアウォールの解除も必要。(送受信どちら側も)
[root@esxi-host01:~] esxcli network firewall set --enabled false
サーバー側
[root@esxi-host01:~] /usr/lib/vmware/vsan/bin/iperf3.copy -s -B 172.16.1.1
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 172.16.1.2, port 25381
[ 5] local 172.16.1.1 port 5201 connected to 172.16.1.2 port 11858
iperf3: getsockopt - Function not implemented
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-1.00 sec 89.2 MBytes 748 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 1.00-2.00 sec 81.5 MBytes 683 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 2.00-3.00 sec 81.2 MBytes 682 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 3.00-4.00 sec 81.3 MBytes 682 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 4.00-5.00 sec 81.3 MBytes 682 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 5.00-6.00 sec 81.3 MBytes 682 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 6.00-7.00 sec 81.2 MBytes 681 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 7.00-8.00 sec 81.3 MBytes 682 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 8.00-9.00 sec 81.3 MBytes 682 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 9.00-10.00 sec 81.3 MBytes 682 Mbits/sec
iperf3: getsockopt - Function not implemented
[ 5] 10.00-10.13 sec 10.3 MBytes 682 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-10.13 sec 0.00 Bytes 0.00 bits/sec sender
[ 5] 0.00-10.13 sec 831 MBytes 688 Mbits/sec receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
クライアント側
[root@esxi-host02:~] /usr/lib/vmware/vsan/bin/iperf3.copy -c 172.16.1.1
Connecting to host 172.16.1.1, port 5201
[ 4] local 172.16.1.2 port 11858 connected to 172.16.1.1 port 5201
iperf3: getsockopt - Function not implemented
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 98.6 MBytes 827 Mbits/sec 8638824 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 1.00-2.00 sec 82.4 MBytes 691 Mbits/sec 0 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 2.00-3.00 sec 81.2 MBytes 681 Mbits/sec 0 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 3.00-4.00 sec 81.4 MBytes 683 Mbits/sec 0 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 4.00-5.00 sec 81.3 MBytes 682 Mbits/sec 0 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 5.00-6.00 sec 81.3 MBytes 682 Mbits/sec 0 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 6.00-7.00 sec 81.2 MBytes 681 Mbits/sec 0 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 7.00-8.00 sec 81.3 MBytes 682 Mbits/sec 0 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 8.00-9.00 sec 81.2 MBytes 682 Mbits/sec 0 0.00 Bytes
iperf3: getsockopt - Function not implemented
[ 4] 9.00-10.00 sec 81.3 MBytes 682 Mbits/sec 4286328472 0.00 Bytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 831 MBytes 697 Mbits/sec 0 sender
[ 4] 0.00-10.00 sec 831 MBytes 697 Mbits/sec receiver
iperf Done.
オプションはお好みで。
-p | サーバ側でListenするポート。クライアントは接続先を指定。 |
-i | インターバル。 |
-u | UDPを使用する。 |
-t | 計測時間(秒)を指定する。 |
-M | tcp の mss。(MTU – 40バイト) |
-B | 送受信に使用するインターフェース(IP)を指定する。 |
root@esxi-host02:~] /usr/lib/vmware/vsan/bin/iperf3.copy -h
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
-F, --file name xmit/recv the specified file
-A, --affinity n/n,m set CPU affinity
-B, --bind <host> bind to a specific interface
-V, --verbose more detailed output
-J, --json output in JSON format
--logfile f send output to a log file
--forceflush force flushing output at every interval
-d, --debug emit debugging output
-v, --version show version information and quit
-h, --help show this message and quit
Server specific:
-s, --server run in server mode
-D, --daemon run the server as a daemon
-I, --pidfile file write PID file
-1, --one-off handle one client connection then exit
Client specific:
-c, --client <host> run in client mode, connecting to <host>
-u, --udp use UDP rather than TCP
-b, --bandwidth #[KMG][/#] target bandwidth in bits/sec (0 for unlimited)
(default 1 Mbit/sec for UDP, unlimited for TCP)
(optional slash and packet count for burst mode)
-t, --time # time in seconds to transmit for (default 10 secs)
-n, --bytes #[KMG] number of bytes to transmit (instead of -t)
-k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n)
-l, --len #[KMG] length of buffer to read or write
(default 128 KB for TCP, dynamic or 1 for UDP)
--cport <port> bind to a specific client port (TCP and UDP, default: ephemeral port)
-P, --parallel # number of parallel client streams to run
-R, --reverse run in reverse mode (server sends, client receives)
-w, --window #[KMG] set window size / socket buffer size
-C, --congestion <algo> set TCP congestion control algorithm (Linux and FreeBSD only)
-M, --set-mss # set TCP/SCTP maximum segment size (MTU - 40 bytes)
-N, --no-delay set TCP/SCTP no delay, disabling Nagle's Algorithm
-4, --version4 only use IPv4
-6, --version6 only use IPv6
-S, --tos N set the IP 'type of service'
-L, --flowlabel N set the IPv6 flow label (only supported on Linux)
-Z, --zerocopy use a 'zero copy' method of sending data
-O, --omit N omit the first n seconds
-T, --title str prefix every output line with this string
--get-server-output get results from server
--udp-counters-64bit use 64-bit counters in UDP test packets
[KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga-
Report bugs to: https://github.com/esnet/iperf
戻すのも忘れずに。
[root@esxi-host01:~] esxcli network firewall set --enabled true
[root@esxi-host01:~] esxcli network firewall get
Default Action: DROP
Enabled: true
Loaded: true
コメント