and*_*kop 4 linux traffic-shaping iproute2
我想限制 Linux box 的传入(下载)速度。
配置的盒子和流量源(HTTP服务器)都连接在同一个交换机上,如果没有配置整形,下载速度为30MBps
我根据http://lartc.org/lartc.html使用 tc
########## downlink #############
# slow downloads down to somewhat less than the real speed to prevent
# queuing at our ISP. Tune to see how high you can set it.
# ISPs tend to have *huge* queues to make sure big downloads are fast
#
# attach ingress policer:
/sbin/tc qdisc add dev $DEV handle ffff: ingress
# filter *everything* to it (0.0.0.0/0), drop everything that's
# coming in too fast:
/sbin/tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
Run Code Online (Sandbox Code Playgroud)
但是,有效下载速度远低于配置。这是我的实验结果
设置速率, KBps :实际速率, KBps
对于小带宽整形效果很好,但在 1024 KBit 上,有效比特率比预期低 75%。
是否可以有效地限制传入带宽?
体重低于预期
我认为你也必须burst
相应地增加。
是否可以有效地限制传入带宽?
我会说你肯定可以达到类似的效果,丢弃数据包,而不是接收它们。对于像 TCP 这样具有带宽自调整机制的 protos,它会有效地工作。看看http://www.linuximq.net/faq.html
归档时间: |
|
查看次数: |
11484 次 |
最近记录: |