加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux上的传入(入口)流量整形 – bw低于预期

发布时间:2020-12-13 16:46:42 所属栏目:Linux 来源:网络整理
导读:我想限制 Linux机箱的传入(下载)速度. 两者,配置的盒子和交通源(HTTP服务器)都连接到同一个交换机,如果没有配置整形,下载速度为30MBps 我根据http://lartc.org/lartc.html使用tc ########## downlink ############## slow downloads down to somewhat less t
我想限制 Linux机箱的传入(下载)速度.

两者,配置的盒子和交通源(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

但是,有效下载速度远远低于配置.这是我的实验结果

设定费率,KBps:实际费率,KBps

> 32 KBps:30 KBps
> 64 KBps:50 KBps
> 128 KBps:106 KBps
> 256 KBps:160 KBps
> 512 KBps:210 KBps
> 1024 KBps:255 KBps

对于小带宽整形工作非常好,但在1024 KBit有效比特率比预期少75%.

是否有可能有效地限制传入带宽?

解决方法

bw is lower than expected

我认为你必须相应增加爆发.

Is is possible to effectively limit incoming bandwidth?

我说你肯定可以达到类似的效果,丢弃数据包,而不是接收它们.对于具有带宽自我调整机制的TCP这样的prot,它会有效地工作.看看http://www.linuximq.net/faq.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读