(資料圖片僅供參考)
WonderShaper是用來對特定網(wǎng)卡進(jìn)行快速限速的工具,它實際是對Linux的tc命令進(jìn)行封裝后的shell腳本,所以使用成本比tc更低,更容易上手,以下配合測速工具speedtest一起使用
2.如何安裝WonderShaper#直接拉取wondershaper,開箱即用git clone https://github.com/magnific0/wondershaper.gitroot@****-5491:/home/soft/wondershaper# ./wondershaper -vVersion 1.4.1root@****-5491:/home/soft/wondershaper# #網(wǎng)速測試工具speedtest安裝(Ubuntu)apt install speedtest-cli--yum install speedtest-cli (centos)3.WonderShaper使用幫助
root@****-5491:/home/soft/wondershaper# ./wondershaper -hUSAGE: ./wondershaper [-hcs] [-a 4.1查看網(wǎng)卡狀態(tài) root@****-5491:/home/soft/wondershaper# ifconfig eno1eno1: flags=4163 4.2限制網(wǎng)卡速度(單位Kbps) -- 下行2048kbps=2 Mbit/s,上行 1024kbps=1 Mbit/sroot@****-5491:/home/soft/wondershaper# ./wondershaper -a eno1 -d 2048 -u 1024--測試網(wǎng)速root@****e-5491:/home/soft/wondershaper# speedtestRetrieving speedtest.net configuration...Testing from China Telecom (120.36.98.11)...Retrieving speedtest.net server list...Selecting best server based on ping...Hosted by Far EasTone Telecom (Miaoli City) [722.10 km]: 174.383 msTesting download speed................................................................................-- 下行速度Download: 1.80 Mbit/sTesting upload speed......................................................................................................--上行速度Upload: 1.28 Mbit/sroot@****-5491:/home/soft/wondershaper# 4.3取消限速 --取消限速root@****-5491:/home/soft/wondershaper# ./wondershaper -c -a eno1-- 查看網(wǎng)卡狀態(tài)root@****-5491:/home/soft/wondershaper# ./wondershaper -s -a eno1qdisc fq_codel 0: root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb ecn Sent 123022 bytes 471 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0 new_flows_len 0 old_flows_len 0-- 測試網(wǎng)速root@****-5491:/home/soft/wondershaper# speedtestRetrieving speedtest.net configuration...Testing from China Telecom (120.36.98.11)...Retrieving speedtest.net server list...Selecting best server based on ping...Hosted by Far EasTone Telecom (Miaoli City) [722.10 km]: 173.886 msTesting download speed................................................................................Download: 11.29 Mbit/sTesting upload speed......................................................................................................Upload: 2.93 Mbit/sroot@****-5491:/home/soft/wondershaper#5.WonderShaper在測試中的應(yīng)用 測試項目:某內(nèi)部數(shù)據(jù)庫遷移工具 測試目的:數(shù)據(jù)遷移中,對目標(biāo)端進(jìn)行限速,當(dāng)取消限速后,傳輸速度可以恢復(fù) 測試步驟:起遷移進(jìn)程,在目標(biāo)端服務(wù)器上用WonderShaper工具進(jìn)行限速: -- 只限制下行速度[#22#root@**** ~/wondershaper]22 ./wondershaper -a enp0s3 -d 100 測試結(jié)果:限速后,寫目標(biāo)庫單位寫入行數(shù)和單位寫入字節(jié)數(shù)都急劇下降,如下圖: 取消限速,恢復(fù)網(wǎng)絡(luò)后,傳輸速率慢慢恢復(fù):6.網(wǎng)速單位轉(zhuǎn)換 1KB/s = 8kbps = 8kb/s比如一般100M的寬帶,實際是100Mbps=(100/8) MB/s=12.5 MB/s7.總結(jié) 使用WonderShaper對網(wǎng)卡進(jìn)行限速,在測試時可以針對性的指定網(wǎng)卡,指定上傳速度或者指定下載速度,在測試中上傳和下載速度是互不影響的,可以只限制一方;且WonderShaper工具操作簡單好入手,是個不錯的工具。 標(biāo)簽:
- 全球焦點!網(wǎng)卡限速工具之WonderShaper
- 熱訊:5G資本支出指數(shù)級增長的日子已過去 但前景并未黯淡
- 最新資訊:抓 Https 加密數(shù)據(jù),偷偷摸摸爽得很!
- 天天速遞!“一箭易斷,十箭難折”——從單鏈路到MC-LAG
- 觀天下!SDN具備的三個好處如何為小型企業(yè)提供幫助
- 環(huán)球觀點:云路由如何構(gòu)建家庭內(nèi)網(wǎng)控制系統(tǒng)?
- 天天播報:聊聊5G應(yīng)用如何賦能千行百業(yè)
- 國潮PC品牌機(jī)械師入選“2022新國貨”榜單 為用戶打造更強(qiáng)悍的新國貨
- 熱訊:面試官竟然把TCP三次握手、四次揮手問的這么詳細(xì)?
- 訊息:美團(tuán)二面:TCP 四次揮手,可以變成三次嗎?