在线乱码卡一卡二卡新HD,最近韩国免费观看视频,国产色无码精品视频国产,亚洲男人的天堂久久香蕉

當前熱訊:網卡限速工具之WonderShaper
來源:GreatSQL社區    時間:2022-08-31 09:05:08


(資料圖片)

1.什么是WonderShaper

WonderShaper是用來對特定網卡進行快速限速的工具,它實際是對Linux的tc命令進行封裝后的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# #網速測試工具speedtest安裝(Ubuntu)apt install speedtest-cli--yum install speedtest-cli (centos)3.WonderShaper使用幫助

root@****-5491:/home/soft/wondershaper# ./wondershaper -hUSAGE: ./wondershaper [-hcs] [-a ] [-d ] [-u ]Limit the bandwidth of an adapterOPTIONS: -h Show this message 【幫助信息】 -a Set the adapter 【指定網卡接口】 -d Set maximum download rate (in Kbps) and/or 【限制下載速度(Kbps)】 -u Set maximum upload rate (in Kbps) 【限制上傳速度(Kbps)】 -p Use presets in "/etc/systemd/wondershaper.conf" -f Use alternative preset file -c Clear the limits from adapter 【清除指定網卡規則,用于取消限速】 -s Show the current status of adapter 【顯示當前網卡的狀態】 -v Show the current version 【顯示當前版本】 Configure HIPRIODST in "/etc/systemd/wondershaper.conf" for hosts requiring high priority i.e. in case ssh uses dport 443.MODES: wondershaper -a -d -u wondershaper -c -a wondershaper -s -a EXAMPLES: 【使用示例】 wondershaper -a eth0 -d 1024 -u 512 【設置網卡eth0的上行速度為512kbps,下行速度為1024kbps】 wondershaper -a eth0 -u 512 【只設置上行速度為512kbps】 wondershaper -c -a eth0 【清除網卡eth0的規則】 wondershaper -p -f foo.conf 【設置指定的配置文件】4.WonderShaper使用示例

4.1查看網卡狀態

root@****-5491:/home/soft/wondershaper# ifconfig eno1eno1: flags=4163 mtu 1500 inet 192.168.5.103 netmask 255.255.255.0 broadcast 192.168.5.255 inet6 fe80::2c93:21f9:1931:304 prefixlen 64 scopeid 0x20 ether c8:f7:50:7e:50:48 txqueuelen 1000 (Ethernet) RX packets 7748809 bytes 1034513376 (1.0 GB) RX errors 0 dropped 439 overruns 0 frame 0 TX packets 15528838 bytes 4784318169 (4.7 GB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 16 memory 0x91500000-91520000 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 4528052159 bytes 14890189 pkt (dropped 0, overlimits 0 requeues 4224) backlog 0b 0p requeues 4224 maxpacket 66616 drop_overlimit 0 new_flow_count 35953 ecn_mark 0 new_flows_len 0 old_flows_len 0--測試網速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 Fuzhou China Mobile,Fujian (Fuzhou) [589.19 km]: 14.449 msTesting download speed................................................................................-- 下載網速是171.43 Mbit/s,Download: 171.43 Mbit/sTesting upload speed......................................................................................................-- 上傳網速是4.15 Mbit/sUpload: 4.15 Mbit/s

4.2限制網卡速度(單位Kbps)

-- 下行2048kbps=2 Mbit/s,上行 1024kbps=1 Mbit/sroot@****-5491:/home/soft/wondershaper# ./wondershaper -a eno1 -d 2048 -u 1024--測試網速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-- 查看網卡狀態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-- 測試網速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在測試中的應用

測試項目:某內部數據庫遷移工具

測試目的:數據遷移中,對目標端進行限速,當取消限速后,傳輸速度可以恢復

測試步驟:起遷移進程,在目標端服務器上用WonderShaper工具進行限速:

-- 只限制下行速度[#22#root@**** ~/wondershaper]22 ./wondershaper -a enp0s3 -d 100

測試結果:限速后,寫目標庫單位寫入行數和單位寫入字節數都急劇下降,如下圖:

取消限速,恢復網絡后,傳輸速率慢慢恢復:6.網速單位轉換

1KB/s = 8kbps = 8kb/s比如一般100M的寬帶,實際是100Mbps=(100/8) MB/s=12.5 MB/s7.總結

使用WonderShaper對網卡進行限速,在測試時可以針對性的指定網卡,指定上傳速度或者指定下載速度,在測試中上傳和下載速度是互不影響的,可以只限制一方;且WonderShaper工具操作簡單好入手,是個不錯的工具。

關鍵詞: 下載速度 測試結果 測試項目 限制上傳速度 限制下載速度

X 關閉

X 關閉

<蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <文本链> <文本链> <文本链> <文本链> <文本链> <文本链>