萬兆帶寬測試方法

1. 安裝netperf

shell

2. 開啓服務點進程

-sh-4.1# ./netserver 測試

Starting netserver at port 12865server

Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPECblog

3. 開啓單個客戶端進程,測試下每一個TCP鏈接的最大吞吐量

-sh-4.1# ./netperf -H 192.168.10.2 -l 60進程

TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.10.2 (192.168.10.2) port 0 AF_INETip

Recv   Send    Send                          get

Socket Socket  Message  Elapsed              it

Size   Size    Size     Time     Throughput  cli

bytes  bytes   bytes    secs.    10^6bits/sec  sed

32768  32768  32768    60.00    3642.99

從測試結果能夠看出,單鏈接的TCP吞吐量爲3.6Gbps左右,這個值與系統的配置有關。

對於萬兆網卡大概須要開啓4個客戶端進程。

4. 四個客戶端進程測試

第一個測試結果:

-sh-4.1# ./netperf -H 192.168.10.2 -l 60

TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.10.2 (192.168.10.2) port 0 AF_INET

Recv   Send    Send                         

Socket Socket  Message  Elapsed             

Size   Size    Size     Time     Throughput 

bytes  bytes   bytes    secs.    10^6bits/sec 

32768  32768  32768    60.00    2520.14

第二個測試結果:

-sh-4.1# ./netperf -H 192.168.10.2 -l 60

TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.10.2 (192.168.10.2) port 0 AF_INET

Recv   Send    Send                         

Socket Socket  Message  Elapsed             

Size   Size    Size     Time     Throughput 

bytes  bytes   bytes    secs.    10^6bits/sec 

32768  32768  32768    60.00    2779.29

第三個測試結果:

-sh-4.1# ./netperf -H 192.168.10.2 -l 60

TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.10.2 (192.168.10.2) port 0 AF_INET

Recv   Send    Send                         

Socket Socket  Message  Elapsed             

Size   Size    Size     Time     Throughput 

bytes  bytes   bytes    secs.    10^6bits/sec 

32768  32768  32768    60.00    1421.87

第四個測試結果:

-sh-4.1# ./netperf -H 192.168.10.2 -l 60

TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.10.2 (192.168.10.2) port 0 AF_INET

Recv   Send    Send                         

Socket Socket  Message  Elapsed             

Size   Size    Size     Time     Throughput 

bytes  bytes   bytes    secs.    10^6bits/sec 

32768  32768  32768    60.00    2766.95

將其進行相加可獲得網卡帶寬:

2520.14 + 2779.29 + 1421.87 + 2766.95 = 9488.25

可知達到物理帶寬的95%。

另外能夠經過shell腳本在萬兆網卡上捕捉數據。

clipboard

獲得的網卡帶寬數據爲9878.4Mbps,達到物理帶寬的98%。

形成的緣由是netperf獲得的吞吐量爲這段60s的平均值,而shell腳本捕捉的是1s的平均值。

相關文章
相關標籤/搜索