Adaptive Queue Max Limit

Hi all.
I have queue tree system which works very well.
The main condition is to set the MaxLimit of the main queues must be less than the effective available bandwidth.

For a sum of reasons, my provider don’t give me a constant bandwidth (i.e. some nights of ice) and the voip is the service more affected.

I am forced each time to manually change the MaxLimit decreasing to the AvgRate I can read from the tree list. After a while, I try to rise MaxLimit of 1Mbit then I observe if AvgRate follow the MaxLimit (my network use always all the bandwidth).

I would realize a script (?) doing the following:

  1. each 5 minutes
  2. if (MaxLimit>4mbit) and (MaxLimit-AvgRate)>500kbit
    then set MaxLimit=AvgRate
    else if (MaxLimit<11Mbit)
    then MaxLimit=MaxLimit+1Mbit
  3. if MaxLimit>11Mbit then MaxLimit=11Mbit
  4. if MaxLimit<4Mbit then MaxLimit=4Mbit
  5. set all MaxLimit of sub queues to MaxLimit

Could someone give me some hints on how to begin this works or if a better way exists ?

Thanks of all.

Try this script added to scheduler:


:local maxLimit [/ queue tree get NAME max-limit]
:local avgRate [/ queue tree get NAME rate]
:if ($maxLimit > 4000000 && ($maxLimit-$avgRate) > 500000) do={
:set maxLimit $avgRate
} else={
:set maxLimit ($maxLimit+1000000)
}
:if ($maxLimit > 11000000) do={
:set maxLimit 11000000
}
:if ($maxLimit < 4000000) do={
:set maxLimit 4000000
}
/ queue tree set NAME max-limit=$maxLimit
/ queue tree { set [find parent=NAME] max-limit=$maxLimit }

override NAME with your queue tree name and wait for results :wink:

BR,
ayufan.

Thanks a lot!
I will try soon.

HI There,

I would like to apply the same script to my ow queue tree but my max download is anywhere up to 4mb and my upload andywhere up to 512kb. Not sure how to modify the script in this instance..

Please could someone assist?

Many Thanks

using value of avg rate of local queue would not make sense for such a purpose

more sense would make to lower max based on traffic conditions such as icmp delay if that can be measured with a script.

Going Up with the max limit - probably by hard set scheduled time.