最近服务器上传下载流量莫名跑的很大。。有点方IDC的QOS。。所以还是决定自己动手。先限速为好。 Github项目地址: https://github.com/magnific0/wondershaper

1
2
3
4
#下载&安装方式:
git clone https://github.com/magnific0/wondershaper.git
cd wondershaper
make install

[infobox title=”使用方法”]USAGE: wondershaper [-hcs] [-a ] [-d ] [-u ] OPTIONS: -h Show this message -a Set the adapter -d Set maximum download rate (in Kbps) and/or -u Set maximum upload rate (in Kbps) -p Use presets in /etc/conf.d/wondershaper.conf -c Clear the limits from adapter -s Show the current status of the adapter -v Show the current version[/infobox]

1
2
3
4
5
6
7
8
9
#案例
#限制上传带宽为10M
wondershaper -a eth0 -u 10240
#限制下载带宽为10M
wondershaper -a eth0 -d 10240
#限制上传和上传均10M
wondershaper -a eth0 -d 10240 -u 10240
#清除网卡限速规则
wondershaper -c -a eth0