暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

linux网络限速(可以限制使用nfs的oracle)

原创 清醒的沉沦 2024-05-27
281

接上一篇,上一篇只考虑了对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

规则不能同时配置,要配置前要先清除之前的配置。
























「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论