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
默认:
k--kbits:
K--Kbytes:
b--bits:
m--Mbits:
g--Gbits:
a--Mbits:
-i, --interval # seconds between periodic bandwidth reports
-F, --file name xmit/recv the specified file
发送和接收指定的文件
-A, --affinity n/n,m set CPU affinity
设置CPU亲和力
-B, --bind <host> bind to a specific interface
绑定到一个指定的接口,这个应该适用于有多个网卡多个IP的主机。
添加IP地址:
绑定:
-V, --verbose more detailed output
-J, --json output in JSON format
Control connection MSS 1448
{
"start": {
"connected": [{
"socket": 4,
"local_host": "192.168.127.132",
"local_port": 49848,
"remote_host": "192.168.127.140",
"remote_port": 5201
}],
"version": "iperf 3.1.7",
"system_info": "Linux localhost.localdomain 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64",
"timestamp": {
"time": "Sat, 07 Sep 2019 05:04:05 GMT",
"timesecs": 1567832645
},
"connecting_to": {
"host": "192.168.127.140",
"port": 5201
},
"cookie": "localhost.localdomain.1567832645.195",
"tcp_mss_default": 1448,
"test_start": {
"protocol": "TCP",
"num_streams": 1,
"blksize": 131072,
"omit": 0,
"duration": 10,
"bytes": 0,
"blocks": 0,
"reverse": 0
}
},
"intervals": [{
"streams": [{
"socket": 4,
"start": 0,
"end": 1.002210,
"seconds": 1.002210,
"bytes": 277172824,
"bits_per_second": 2.212493e+09,
"retransmits": 0,
"snd_cwnd": 828256,
"rtt": 1804,
"omitted": false
}],
"sum": {
"start": 0,
"end": 1.002210,
"seconds": 1.002210,
"bytes": 277172824,
"bits_per_second": 2.212493e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 1.002210,
"end": 2.001760,
"seconds": 0.999550,
"bytes": 306708480,
"bits_per_second": 2.454773e+09,
"retransmits": 0,
"snd_cwnd": 1103376,
"rtt": 3035,
"omitted": false
}],
"sum": {
"start": 1.002210,
"end": 2.001760,
"seconds": 0.999550,
"bytes": 306708480,
"bits_per_second": 2.454773e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 2.001760,
"end": 3.000119,
"seconds": 0.998359,
"bytes": 349962240,
"bits_per_second": 2.804300e+09,
"retransmits": 0,
"snd_cwnd": 1135232,
"rtt": 2277,
"omitted": false
}],
"sum": {
"start": 2.001760,
"end": 3.000119,
"seconds": 0.998359,
"bytes": 349962240,
"bits_per_second": 2.804300e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 3.000119,
"end": 4.002199,
"seconds": 1.002080,
"bytes": 356515840,
"bits_per_second": 2.846207e+09,
"retransmits": 0,
"snd_cwnd": 1216320,
"rtt": 2888,
"omitted": false
}],
"sum": {
"start": 3.000119,
"end": 4.002199,
"seconds": 1.002080,
"bytes": 356515840,
"bits_per_second": 2.846207e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 4.002199,
"end": 5.037014,
"seconds": 1.034815,
"bytes": 146800640,
"bits_per_second": 1.134894e+09,
"retransmits": 0,
"snd_cwnd": 1330712,
"rtt": 2228,
"omitted": false
}],
"sum": {
"start": 4.002199,
"end": 5.037014,
"seconds": 1.034815,
"bytes": 146800640,
"bits_per_second": 1.134894e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 5.037014,
"end": 6.002375,
"seconds": 0.965361,
"bytes": 285736960,
"bits_per_second": 2.367918e+09,
"retransmits": 0,
"snd_cwnd": 1368360,
"rtt": 2119,
"omitted": false
}],
"sum": {
"start": 5.037014,
"end": 6.002375,
"seconds": 0.965361,
"bytes": 285736960,
"bits_per_second": 2.367918e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 6.002375,
"end": 7.002584,
"seconds": 1.000209,
"bytes": 268697600,
"bits_per_second": 2.149132e+09,
"retransmits": 0,
"snd_cwnd": 1394424,
"rtt": 2310,
"omitted": false
}],
"sum": {
"start": 6.002375,
"end": 7.002584,
"seconds": 1.000209,
"bytes": 268697600,
"bits_per_second": 2.149132e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 7.002584,
"end": 8.001739,
"seconds": 0.999155,
"bytes": 353894400,
"bits_per_second": 2.833549e+09,
"retransmits": 0,
"snd_cwnd": 1408904,
"rtt": 2078,
"omitted": false
}],
"sum": {
"start": 7.002584,
"end": 8.001739,
"seconds": 0.999155,
"bytes": 353894400,
"bits_per_second": 2.833549e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 8.001739,
"end": 9.000216,
"seconds": 0.998477,
"bytes": 367001600,
"bits_per_second": 2.940491e+09,
"retransmits": 0,
"snd_cwnd": 1411800,
"rtt": 1768,
"omitted": false
}],
"sum": {
"start": 8.001739,
"end": 9.000216,
"seconds": 0.998477,
"bytes": 367001600,
"bits_per_second": 2.940491e+09,
"retransmits": 0,
"omitted": false
}
}, {
"streams": [{
"socket": 4,
"start": 9.000216,
"end": 10.001968,
"seconds": 1.001752,
"bytes": 364380160,
"bits_per_second": 2.909943e+09,
"retransmits": 0,
"snd_cwnd": 1426280,
"rtt": 1983,
"omitted": false
}],
"sum": {
"start": 9.000216,
"end": 10.001968,
"seconds": 1.001752,
"bytes": 364380160,
"bits_per_second": 2.909943e+09,
"retransmits": 0,
"omitted": false
}
}],
"end": {
"streams": [{
"sender": {
"socket": 4,
"start": 0,
"end": 10.001968,
"seconds": 10.001968,
"bytes": 3076870744,
"bits_per_second": 2.461012e+09,
"retransmits": 0,
"max_snd_cwnd": 1426280,
"max_rtt": 3035,
"min_rtt": 1768,
"mean_rtt": 2249
},
"receiver": {
"socket": 4,
"start": 0,
"end": 10.001968,
"seconds": 10.001968,
"bytes": 3069883160,
"bits_per_second": 2.455423e+09
}
}],
"sum_sent": {
"start": 0,
"end": 10.001968,
"seconds": 10.001968,
"bytes": 3076870744,
"bits_per_second": 2.461012e+09,
"retransmits": 0
},
"sum_received": {
"start": 0,
"end": 10.001968,
"seconds": 10.001968,
"bytes": 3069883160,
"bits_per_second": 2.455423e+09
},
"cpu_utilization_percent": {
"host_total": 35.302936,
"host_user": 0.213831,
"host_system": 35.088035,
"remote_total": 44.182136,
"remote_user": 0.179000,
"remote_system": 44.015385
},
"sender_tcp_congestion": "cubic",
"receiver_tcp_congestion": "cubic"
}
}
--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)
--fq-rate #[KMG] enable fair-queuing based socket pacing in
bits/sec (Linux only)
-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-
iperf3 homepage at: http://software.es.net/iperf/
Report bugs to: https://github.com/esnet/iperf