What's new

AutoBW: Automatically set QoS bandwidth using spdMerlin

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Still getting some Syntax errors with latest stable Merlin release 384.18 and spdmerlin 3.6.1
The up/down rates need to be rounded from decimal to integer before using in the if statements. It’s an AutoBW change needed.
 
The up/down rates need to be rounded from decimal to integer before using in the if statements. It’s an AutoBW change needed.
Does AutoBW work with cake or is on strictly for FreshJr or FlexQoS?
 
Does AutoBW work with cake or is on strictly for FreshJr or FlexQoS?
I know it will work with any usage of Adaptive QoS. Can't speak to cake, but I think the output of the AutoBW tests are relevant if performed without QoS shaping the test traffic.
 
is this the latest/recommended version?
thanks
anyone running this on a schedule in non-test mode, with FlexQoS? how's your experience?
 
This worked for me (08.07.2020):
*Please pre-install spdmerlin via amtm and let it run for 1 Time before following the installation of AutoBW

Install Script with this command ->
Code:
curl "https://raw.githubusercontent.com/jackyaz/AutoBW/master/AutoBW" -o /jffs/scripts/AutoBW && chmod 755 /jffs/scripts/AutoBW

Install "bc" via Entware ->
Code:
opkg install bc

Install "nano" via Entware ->
Code:
opkg install nano

Start Script one time with
Code:
/jffs/scripts/AutoBW

Edit AutoBW for your needs and remove Test Mode
Code:
nano /jffs/scripts/AutoBW

Nano into services-start and add a Cron to let AutoBW adjust QOS speed for example every 10 Hours.
Code:
nano /jffs/scripts/services-start
and add this ->
Code:
cru a AutoBW "0 */10 * * * /jffs/scripts/AutoBW"

Enjoy.

--------EDIT-------

Still getting some Syntax errors with latest stable Merlin release 384.18 and spdmerlin 3.6.1
@Jack Yaz

Code:
TEST MODE: No changes will be made.

              ---------------- SPDMERLIN -------------

                Download (Kbps)       Upload (Kbps)

              -------------------  -------------------

Test  1 of  2       75786.2              35502.1

Test  2 of  2       78551.0              35502.1

Average             77168.6              35502.1

Scale Factors          0.85                 0.85

Scaled Speeds       65593.3              30176.8


              ----------------- QOS ----------------

                Download (Kbps)      Upload (Kbps)

              -------------------  -----------------

Previous              63962.0             25867.0

New (from above)      65593.3             30176.8

[: 25866.9999104: bad number

[: 63961.9999744: bad number

Scaling by              1.026               1.167


              ====================================== DOWNLOAD ======================================

              ----------------- RATE -----------------    ----------------- CEIL -----------------

Class            Previous (Kbps)        New (Kbps)           Previous (Kbps)         New (Kbps)

-----          -------------------  -------------------    -------------------  -------------------

11                     9594.0             9838.7                   63962.0            65593.3

10                     3198.0             3279.6                   63962.0            65593.3

13                    12792.0            13118.3                   63962.0            65593.3

12                    19188.0            19677.4                   63962.0            65593.3

15                     3198.0             3279.6                   63962.0            65593.3

14                     6396.0             6559.1                   63962.0            65593.3

17                     3198.0             3279.6                   63962.0            65593.3

16                     6396.0             6559.1                   63962.0            65593.3


              ======================================= UPLOAD =======================================

              ----------------- RATE -----------------    ----------------- CEIL -----------------

Class            Previous (Kbps)        New (Kbps)           Previous (Kbps)         New (Kbps)

-----          -------------------  -------------------    -------------------  -------------------

(standard_in) 1: syntax error

(standard_in) 1: syntax error

 0                        0.0                0.0                       0.0                0.0

also getting this error without Testmode

Code:
 ---------------- SPDMERLIN -------------

                Download (Kbps)       Upload (Kbps)

              -------------------  -------------------

Test  1 of  4       77312.0              35522.6

Test  2 of  4       78663.7              35512.3

Test  3 of  4       78725.1              35409.9

Test  4 of  4       78776.3              35502.1

Average             78369.3              35486.7

Scale Factors          0.85                 0.85

Scaled Speeds       66613.9              30163.7


              ----------------- QOS ----------------

                Download (Kbps)      Upload (Kbps)

              -------------------  -----------------

Previous              63962.0             25867.0

New (from above)      66613.9             30163.7

[: 25866.9999104: bad number

[: 63961.9999744: bad number

Scaling by              1.041               1.166


              ====================================== DOWNLOAD ======================================

              ----------------- RATE -----------------    ----------------- CEIL -----------------

Class            Previous (Kbps)        New (Kbps)           Previous (Kbps)         New (Kbps)

-----          -------------------  -------------------    -------------------  -------------------

11                     9594.0             9991.8                   63962.0            66613.9

10                     3198.0             3330.6                   63962.0            66613.9

13                    12792.0            13322.4                   63962.0            66613.9

12                    19188.0            19983.5                   63962.0            66613.9

15                     3198.0             3330.6                   63962.0            66613.9

14                     6396.0             6661.2                   63962.0            66613.9

17                     3198.0             3330.6                   63962.0            66613.9

16                     6396.0             6661.2                   63962.0            66613.9


              ======================================= UPLOAD =======================================

              ----------------- RATE -----------------    ----------------- CEIL -----------------

Class            Previous (Kbps)        New (Kbps)           Previous (Kbps)         New (Kbps)

-----          -------------------  -------------------    -------------------  -------------------

(standard_in) 1: syntax error

(standard_in) 1: syntax error

 0                        0.0                0.0                       0.0                0.0

Illegal "prio"

Usage: ... qdisc add ... htb [default N] [r2q N]

                      [direct_qlen P]

 default  minor id of class to which unclassified packets are sent {0}

 r2q      DRR quantums are computed as rate in Bps/r2q {10}

 debug    string of 16 numbers each 0-3 {0}


 direct_qlen  Limit of the direct queue {in packets}

... class add ... htb rate R1 [burst B1] [mpu B] [overhead O]

                      [prio P] [slot S] [pslot PS]

                      [ceil R2] [cburst B2] [mtu MTU] [quantum Q]

 rate     rate allocated to this class (class can still borrow)

 burst    max bytes burst which can be accumulated during idle period {computed}

 mpu      minimum packet size used in rate computations

 overhead per-packet size overhead used in rate computations

 linklay  adapting to a linklayer e.g. atm

 ceil     definite upper class rate (no borrows) {rate}

 cburst   burst but for ceil {computed}

 mtu      max packet size we create rate map for {1600}

 prio     priority of leaf; lower are served first {0}

 quantum  how much bytes to serve from leaf at once {use r2q}


TC HTB version 3.3
thanks for this info. i've disabled spdmerlin scheduled runs, and instead have AutoBW running every 30min (my speeds fluctuate a lot). and i still get spdmerlin webgui results. really nice.
the only thing missing from this script is the option to manually set speed values: "/jffs/scripts/AutoBW 300 10", and the option to add the crontab entry. or maybe just merge AutoBW functionality into spdmerlin
 
Last edited:
I'm contemplating absorbing AutoBW's features into spdMerlin. How are people currently using it? Would users want to specify X runs every 30/60minutes, and use the average for the result? Or 1 run per 30/60 as spdmerlin does now, and average the last X runs?
 
I'm contemplating absorbing AutoBW's features into spdMerlin. How are people currently using it? Would users want to specify X runs every 30/60minutes, and use the average for the result? Or 1 run per 30/60 as spdmerlin does now, and average the last X runs?

maybe config allows to:
- specify frequency to run spdMerlin: every 30, 60, 120, etc minutes
- specify if and how many recent results to average when checking for qos speeds
- specify how large of change needed (%), to trigger a qos speed correction (to avoid constant changes with minor differences)
- specify if each spd run should be single or double.
- qos corrections would use wan results only(?)
 
I'm contemplating absorbing AutoBW's features into spdMerlin. How are people currently using it? Would users want to specify X runs every 30/60minutes, and use the average for the result? Or 1 run per 30/60 as spdmerlin does now, and average the last X runs?
I have it running as a cron job through the middle of night, found out pretty fast if i let it run during heavy usage times it skewed results pretty bad. For some reason when I set it to run at boot up it sets my manual bandwith back to automatic half the time(probably 0 and 0?) Averaging results over the last X number of runs would be great.
 
Started absorbing this into spdMerlin - I think rather than meddle with tc manually as the script does now, is simply update the bandwidth values and issue a qos restart. asus fw and flexqos (if installed) can handle the tc calculations from there.
FYI, FlexQoS won’t do anything on just a restart_qos. It takes a restart_firewall to get off its a$$.

Also, do you think bc is really needed still?
 
FYI, FlexQoS won’t do anything on just a restart_qos. It takes a restart_firewall to get off its a$$.

Also, do you think bc is really needed still?
noted re. firewall restart, perhaps best to issue both?

probably not, since all that's needed with my proposed approach is to multiply Mbps to Kbps!
edit: tell a lie, multiplying by decimals might need bc unless I use my awk method from other scripts
 
noted re. firewall restart, perhaps best to issue both?

probably not, since all that's needed with my proposed approach is to multiply Mbps to Kbps!
edit: tell a lie, multiplying by decimals might need bc unless I use my awk method from other scripts
It would be ungentlemanly to restart the firewall only for FlexQoS when a QoS restart would be enough for non-Flex users. After a QoS restart, if /jffs/addon/flexqos/flexqos.sh is present, you can fork a /jffs/addon/flexqos/flexqos.sh -check & and it will cleanup the needed rules. At least until I can think of a better way to handle these restarts. I think FreshJR used firewall-restart to ensure we receive the correct wan ifname for iptables, but I’ve always seen the mangle table flushed on a restart_qos so I should handle both events in the future.

Another kludge is to set the bandwidth and restart QoS around 03:25 AM just before the nightly FlexQoS persistence check. Assuming it becomes an automated process...
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top