ASP源码.NET源码PHP源码JSP源码JAVA源码DELPHI源码PB源码VC源码VB源码Android源码
当前位置:首页 >> 操作系统 >> Linux教程 >> iperf3实践

iperf3实践(1/8)

来源:网络整理     时间:2016-04-15     关键词:iperf

本篇文章主要介绍了"iperf3实践",主要涉及到iperf方面的内容,对于Linux教程感兴趣的同学可以参考一下: The basic commands are the same for iperf and iperf3:SAMPLE IPERF/IPERF3 COMMAND...

The basic commands are the same for iperf and iperf3:

SAMPLE IPERF/IPERF3 COMMANDS
Server:
iperf/iperf3 -sStart server on the default port
iperf -s -w 32M -D / iperf3 -s -DStart server with larger TCP window, and in daemon mode
iperf -i1 -u -s -p 5003 / iperf3 -s -p 5003Start UDP server on port 5003, and give 1 sec interval reports
Client
iperf/iperf3 -c remotehost -i 1 -t 30Run a 30 second tests, giving results every 1 second
iperff/iperf3 -c remotehost -i 1 -t 20 -rRun a test from remotehost to localhost
iperf/iperf3 -c remotehost -i 1 -t 20 -w 32M -P 4Run a test with 4 parallel streams, and with a 32M TCP buffer
iperf/iperf3 -c remotehost -u -i 1 -b 200M Run a 200 Mbps UDP test
 

iperf3 adds a number of additional features. For example, the -i mode now reports TCP retransmit info (and is on by default), and the verbose mode now gives a lot of useful information on CPU usage, etc. Other new options include:

NEW IPERF3 COMMANDS
Client:
iperf3 -c remotehost -i.5 -0 2Run the test for 2 seconds before collecting results, to allow for TCP slowstart to finish. (Omit mode)
iperf3 -Z -c remotehostUse the sendfile() system call for "Zero Copy" mode. This uses much less CPU.
iperf3 -c 192.168.12.12 -T s1 & iperf3 -c 192.168.12.13 -T s2Run tests to multiple interfaces at once, and label the lines to indicate which test is which
iperf3 -c remotehost -JOutput the results in JSON format for easy parsing.
iperf3 -A 4,4 -c remotehostSet the CPU affinity for the sender,receiver (cores are numbered from 0). This has the same affect as doing 'numactl -C 4 iperf3'.

iperf3 -c 10.20.1.20 -A2,2 -T "1" & ; iperf3 -c 10.20.1.20 -p 5400 -A3,3 -T "2" &

Run 2 streams on 2 different cores, and label each using the "-T" flag.

iperf3 thread model

In order to keep the code as simple and maintainable as possible, iperf3 is single threaded. This means that that you may be CPU-bound on some hosts, or on 40G/100G NICs. To run parallel stream iperf3 on mutiple cores, use the method shown in the table above.

实践:

[root@CentOS7 iperf-3.1.2]# iperf3 -s

-----------------------------------------------------------

Server listening on 5201

-----------------------------------------------------------

Accepted connection from 192.168.56.106, port 58465

[  5] local 192.168.56.103 port 5201 connected to 192.168.56.106 port 58466

[ ID] Interval           Transfer     Bandwidth

[  5]   0.00-1.00   sec  49.9 MBytes   418 Mbits/sec                  

[  5]   1.00-2.00   sec   175 MBytes  1.47 Gbits/sec                  

[  5]   2.00-3.00   sec   148 MBytes  1.25 Gbits/sec                  

[  5]   3.00-4.00   sec   164 MBytes  1.38 Gbits/sec                  

[  5]   4.00-5.00   sec   234 MBytes  1.96 Gbits/sec                  

相关图片

相关文章