Linux:iPerf(网络性能测试)

https://iperf.fr/iperf-download.php

[root@king01 ~]# tar zxvf iperf-3.1.3-source.tar.gz
[root@king01 ~]# cd iperf-3.1.3
[root@king01 iperf-3.1.3]# ./configure
[root@king01 iperf-3.1.3]# make
[root@king01 iperf-3.1.3]# make install

[root@king01 ~]# 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
  -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
  -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, 8 KB 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-

[root@king01 ~]# perf3 -s -D
[root@king01 ~]# netstat -tunlp | grep iperf
tcp        0      0 :::5201        :::*        LISTEN        28691/iperf3

[root@king02 ~]# iperf3 -c 192.168.1.201 -f MBytes
Connecting to host 192.168.30.70, port 5201
[  4] local 192.168.30.32 port 39074 connected to 192.168.1.201 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  12.3 MBytes  12.3 MBytes/sec  124    229 KBytes       
[  4]   1.00-2.00   sec  11.2 MBytes  11.2 MBytes/sec    0    243 KBytes       
[  4]   2.00-3.00   sec  11.2 MBytes  11.2 MBytes/sec    0    259 KBytes       
[  4]   3.00-4.00   sec  11.2 MBytes  11.2 MBytes/sec    1    209 KBytes       
[  4]   4.00-5.00   sec  11.2 MBytes  11.2 MBytes/sec    0    238 KBytes       
[  4]   5.00-6.00   sec  11.2 MBytes  11.2 MBytes/sec    0    255 KBytes       
[  4]   6.00-7.00   sec  11.2 MBytes  11.2 MBytes/sec    0    263 KBytes       
[  4]   7.00-8.00   sec  11.2 MBytes  11.2 MBytes/sec    0    266 KBytes       
[  4]   8.00-9.00   sec  11.2 MBytes  11.2 MBytes/sec    3    221 KBytes       
[  4]   9.00-10.00  sec  11.2 MBytes  11.2 MBytes/sec    0    245 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   113 MBytes  11.3 MBytes/sec  128             sender
[  4]   0.00-10.00  sec   112 MBytes  11.2 MBytes/sec                  receiver
iperf Done.


猜你喜欢

转载自blog.51cto.com/13598811/2341566