接上一篇,上一篇只考虑了对rman限速,有些情况下可能需要对网卡进行限速(adg在异地,使用的网络和业务是同一根专线,防止归档暴增情况下占太多带宽)
我使用的是wondershaper工具对linux的网卡进行限速。
下载地址:https://github.com/magnific0/wondershaper
命令的简单介绍:
[root@test wondershaper-master]# ./wondershaper
Please supply the adapter name for the mode.
USAGE: ./wondershaper [-hcs] [-a <adapter>] [-d <rate>] [-u <rate>]
Limit the bandwidth of an adapter
OPTIONS:
-h Show this message
-a <adapter> Set the adapter
-d <rate> Set maximum download rate (in Kbps) and/or
-u <rate> Set maximum upload rate (in Kbps)
-p Use presets in "/etc/systemd/wondershaper.conf"
-f <file> 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 <adapter> -d <rate> -u <rate>
wondershaper -c -a <adapter>
wondershaper -s -a <adapter>
EXAMPLES:
wondershaper -a eth0 -d 1024 -u 512
wondershaper -a eth0 -u 512
wondershaper -c -a eth0
wondershaper -p -f foo.conf
常用的例子:
#限制上传带宽为20M
wondershaper -a ens33 -u 20480
#限制下载带宽为20M
wondershaper -a ens33 -d 20480
#限制上传和上传均10M
wondershaper -a ens33 -d 20480 -u 20480
#清除网卡限速规则
wondershaper -c -a ens33
规则不能同时配置,要配置前要先清除之前的配置。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69924215/viewspace-3016672/ ,如需转载,请注明出处,否则将追究法律责任。