目錄
一、實驗
1.環(huán)境
2.TCP網(wǎng)絡(luò)吞吐量的微觀基準(zhǔn)測試
二、問題
1.iperf參數(shù)有哪些
2.iperf如何二進制安裝
一、實驗
1.環(huán)境
(1)主機
表1-1 主機
主機 | 架構(gòu) | 組件 | IP | 備注 |
prometheus | 監(jiān)測 系統(tǒng) |
prometheus、node_exporter | ?192.168.204.18 | |
grafana | 監(jiān)測GUI | grafana | 192.168.204.19 | |
agent? | 監(jiān)測 主機 |
node_exporter | 192.168.204.20 |
2.使用 iperf3進行TCP網(wǎng)絡(luò)吞吐量的微觀基準(zhǔn)測試
(1)prometheus服務(wù)器安裝iperf3
① 查找
[root@prometheus ~]# yum search iperf
②安裝
[root@prometheus ~]# yum install iperf3
③查看版本
[root@prometheus ~]# iperf3 -v
④ 幫助命令
[root@prometheus ~]# iperf3 -h
(2)agent?服務(wù)器安裝iperf3
① 查找
[root@agent ~]# yum search iperf
②安裝
[root@agent ~]# yum install iperf3
③查看版本
[root@agent ~]# iperf3 -v
? (3) prometheus服務(wù)器執(zhí)行iperf命令
[root@prometheus ~]# iperf3 -s -d
(4)agent服務(wù)器執(zhí)行iperf命令
測試基準(zhǔn)執(zhí)行10秒(-t 10),并產(chǎn)生每秒的平均數(shù)(-i 1)
iperf3 -c 192.168.204.18 -i 1 -t 10
(5)觀察prometheus服務(wù)器iperf命令的監(jiān)聽變化
(6)監(jiān)聽結(jié)束,關(guān)閉
二、問題
1.iperf參數(shù)有哪些
(1)主要參數(shù)
-s 以server模式啟動。#iperf -s
-c host以client模式啟動。host是server端地址。#iperf -c serverip
(2)通用參數(shù)
-f [kmKM] 分別表示以Kbits, Mbits, KBytes, MBytes顯示報告,默認(rèn)以Mbits為單位,#iperf -c 192.168.204.18 -f K
-i sec 以秒為單位顯示報告間隔,#iperf -c 192.168.204.18 -i 2
-l 緩沖區(qū)大小,默認(rèn)是8KB,#iperf -c 192.168.204.18 -l 64
-m 顯示tcp最大mtu值
-o 將報告和錯誤信息輸出到文件#iperf -c 192.168.204.18 -o ciperflog.txt
-p 指定服務(wù)器端使用的端口或客戶端所連接的端口#iperf -s -p 5001;iperf -c 192.168.204.18 -p 5001
-u 使用udp協(xié)議
-w 指定TCP窗口大小,默認(rèn)是8KB
-B 綁定一個主機地址或接口(當(dāng)主機有多個地址或接口時使用該參數(shù))
-C 兼容舊版本(當(dāng)server端和client端版本不一樣時使用)
-M 設(shè)定TCP數(shù)據(jù)包的最大mtu值
-N 設(shè)定TCP不延時
-V 傳輸ipv6數(shù)據(jù)包
(3)server專用參數(shù)
-D 以服務(wù)方式運行。#iperf -s -D
-R 停止iperf服務(wù)。針對-D,#iperf -s -R
client端專用參數(shù):
-d 同時進行雙向傳輸測試
-n 指定傳輸?shù)淖止?jié)數(shù),#iperf -c 192.168.204.18 -n 1024000
-r 單獨進行雙向傳輸測試
-t 測試時間,默認(rèn)20秒,#iperf -c 192.168.204.18 -t 5
-F 指定需要傳輸?shù)奈募?-T 指定ttl值
(4)使用
1)服務(wù)器端 執(zhí)行
iperf -s -d
2)客戶端執(zhí)行
iperf -c 192.168.204.18 -t 10 -i 1 -d -m
2.iperf如何二進制安裝
(1)iperf官網(wǎng)下載
http://sourceforge.net/projects/iperf/文章來源:http://www.zghlxwxcb.cn/news/detail-777813.html
(2)安裝文章來源地址http://www.zghlxwxcb.cn/news/detail-777813.html
1)下載后解壓
tar xvf iperf-xxxx.tar.gz
cd c-xxxx
./configure
make
make install
2)如果編譯失敗可重新編譯:
make distclean
./configure
make&&make install
到了這里,關(guān)于性能分析與調(diào)優(yōu): Linux 使用 iperf3 進行TCP網(wǎng)絡(luò)吞吐量測試的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!