iperf 可以用來測試
。兩台主機之間的網路資料傳輸量
。測試網卡實際可以跑的極限,或是 swith
用法:
找一台主機當 server (192.168.1.1),執行下列指令
iperf -s
而 client 端則
iperf -c 192.168.1.1
結果顯示:
server
————————————————————
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
————————————————————
[ 4] local 192.168.1.1 port 5001 connected with 192.168.1.2 port 2934
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.0 sec 345 MBytes 289 Mbits/sec
client
————————————————————
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 8.00 KByte (default)
————————————————————
[1912] local 192.168.1.2 port 2934 connected with 192.168.1.1 port 5001
[ ID] Interval Transfer Bandwidth
[1912] 0.0-10.0 sec 345 MBytes 289 Mbits/sec
再來 client 端進一步的參數測試
持續300秒,而30秒顯示一次數據
iperf -c 192.168.1.1 -t 300 -i 30
————————————————————
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 8.00 KByte (default)
————————————————————
[1912] local 192.168.1.2 port 2300 connected with 192.168.1.1 port 5001
[ ID] Interval Transfer Bandwidth
[1912] 0.0-30.0 sec 1.28 GBytes 366 Mbits/sec
[1912] 30.0-60.0 sec 1.30 GBytes 373 Mbits/sec
[1912] 60.0-90.0 sec 1.32 GBytes 379 Mbits/sec
[1912] 90.0-120.0 sec 1.25 GBytes 359 Mbits/sec
[1912] 120.0-150.0 sec 1.17 GBytes 336 Mbits/sec
[1912] 150.0-180.0 sec 1.29 GBytes 369 Mbits/sec
[1912] 180.0-210.0 sec 1.32 GBytes 377 Mbits/sec
[1912] 210.0-240.0 sec 1.31 GBytes 376 Mbits/sec
[1912] 240.0-270.0 sec 1.25 GBytes 359 Mbits/sec
[1912] 270.0-300.0 sec 1.27 GBytes 364 Mbits/sec
[1912] 0.0-300.0 sec 12.8 GBytes 366 Mbits/sec
如果要壓力測試的話 iperf 有 (client 端)
-P 5 同時模擬5個client端對server傳輸
-w 指定 TCP windows 大小,也可以把它想成是一個檔案的大小
留言
iperf -c server_ip -w 100M -t 60 -i 10