当前位置: 首页 > 系统与网络 > 正文

[分享]ROS 限速设置 Burst突发速率

路由系统:RouterOS 6
很早以前就在限速上配置Burst参数,使其达到最佳状态。由于出口带宽扩容,所以对某单位的网络速率模板进行调整,但发现一个问题,当设置Burst参数后,存在每隔几秒,限速抖动的情况,通常是每隔几秒后会往上串1-2s的高速,又回到限速值去。

比如这是一个限速20M的账号,那么在测速还是进行下载的时候,带宽利用率是这样子的:

你会看到速度波动的厉害,下载在2.3-2.8M之间波动,每隔几秒发生一次。

限速配置是这样的:

重新温习ROS,在官方文档里对其各选项描述
官方WIKI:https://wiki.mikrotik.com/wiki/Manual:Queues_-_Burst
Burst is a feature that allows to satisfy queue requirement for additional bandwidth even if required rate is bigger that MIR (max-limit) for a limited period of time.

burst-limit (NUMBER) : maximal upload/download data rate which can be reached while the burst is allowed
burst-time (TIME) : period of time, in seconds, over which the average data rate is calculated. (This is NOT the time of actual burst)
burst-threshold (NUMBER) : this is value of burst on/off switch
average-rate (read-only) : Every 1/16 part of the burst-time, the router calculates the average data rate of each class over the last burst-time seconds
actual-rate (read-only) : actual traffic transfer rate of the queue

对比选项里的,Burst-Rate:突发最大限速。比如允许在5秒内达到100M,之后再回到限速值。该值必须大于限速值。Burst-Threshold突发阀值。最长突发时间的计算公式是longest-burst-time = burst-threshold * burst-time / burst-limit。举个栗子:比如rate-limit是20M,burst-threshold是20M,burst-time是15秒,burst-limit限速100M,则可以达到100M的时间是3秒,3秒后速度降回20M。

官方简单图解:
Values: limit-at=1M , max-limit=2M , burst-threshold=1500k , burst-limit=4M

Client will try to download two 4MB (32Mb) blocks of data, first download will start at zero seconds, second download will start at 17th second. Traffic was unused for last minute.
客户要求下载2个4MB的文件,从0秒开始下载,在第17秒开始第二次下载。传输停止在最后一分钟。

As we can see as soon as client requested bandwidth it was able to get 4Mpbs burst for 6 seconds. This is longest possible burst with given values (longest-burst-time = burst-threshold * burst-time / burst-limit). As soon as burst runs out rest of the data will be downloaded with 2Mbps. This way block of data was downloaded in 9 seconds – without burst it would take 16 seconds. Burst have 7 seconds to recharge before next download will start.

上述罗里吧嗦的一堆,第一图简单说是前6秒的时候带宽达到限制的burst-limit=4M,当6秒之后带宽回落到2M,max-limit=2M。下载第一份数据全程共花费了9秒,第二个下载的时候在第16秒,因为有7秒的时间是没流量情况,所以Burst是重新开始计算。
(补充:如果依然是按这个栗子的限速规则,按照longest-burst-time的计算公式,假设Burst-time是16秒,则比如当这个4M文件在限速2M的区段并未下载完成的时候,暂停之后重新下载,在6秒内执行的话依然是2M的限速,超过6秒无流量情况则会重新执行Burst突发限速)
WIKI里边的太多了,需要自行理解消化。

但是上述的又有个问题,就是前面提到的,如果不是恰到好处的限速,则会出现速率波动的情况。

关于怎么在ROS上配置突发限速,在我的博客上搜。

本文固定链接: http://blog.ich8.com/post/6502 | 霸王硬上弓's Blog

avatar
该日志由 霸王硬上弓 于2017年10月01日发表在 系统与网络 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: [分享]ROS 限速设置 Burst突发速率 | 霸王硬上弓's Blog

[分享]ROS 限速设置 Burst突发速率:等您坐沙发呢!

发表评论

您必须 [ 登录 ] 才能发表留言!