Yes, my current script constantly diffuses through bandwidth space going up if sufficient time passes with no delay and down if there is delay. my concern was it would lead to excessive oscillation but so far seems ok. it adjusts every ~ 40 seconds
TCP uses am AIMD controller for a reason, so I would recommend to be quicker to scale down than up, if only to suppress undesired oscillations, no?
EDIT: Removed old partial posting from top...
1 Like
Yeah, it is slightly biased towards downscaling at the moment. It uses a random factor uniform(.85,1) to scale down, and uniform(1,1.15) to scale up... the first followed by the second averages just slightly below 1 (close to .994). It might be better to make it even just slightly less, like unif(1,1.12) to scale up... which averages about 0.98, I just did some simulations and made that change in my code. Haven't pushed it yet.
Ok, I also added more extensive catching to the monitor_a_site function, and pushed it. Try the unplug for a few seconds and see if it dies.
Yes, this seems to fix the crashing. I wasn't able to leave it off as long as I did the other day when I was screwing with the encapsulation & bridging stuff, but it turns out the isp doesn't support PPPoEoATM that the customer can switch to without calling at least, and I would guess a business/multi ip fee too.
The only thing I wish was different now is the size of the erlang environment. This limits the routers this can be used with, at least the ones sitting on my shelf which would be good candidates to load up with SQM and send to a couple of my less tech savvy friends who suffer from slow DSL out of state 
Now there's an idea... yeah, when I mentioned to a few people that I have a solution to their laggs, there has been great interest, and bugging for updates... I guess minecraft is spanning two generations in their house xD not my thing, but Ill pass the ping improvement along haha
Getting the TP-Link Onhub running on openwrt would be ideal... but I don't know enough yet or have the time
@dlakelan, Here is a crazy idea, collectd-mod-ping (name from memory) will repeatedly ping an arbitrary list of IP addresses and store the results into an rrd database, maybe you could use the same backing store? That would potentially allow to also easily create plots of RTT and loss over time? Or maybe that could be optionally used as collection method? I know this is a bit late, after you solved all problems 
1 Like
Hi there,
I'm not really sure if it's the suitable topic for my question but i'll be glad if you can help with my simple question;
According to my ISP subscription, my bandwidth changes on specific time frame on daily basis.
I've bandwidth of 50/5 mbits between 00:00 and 19:00 and 20/5 mbits between 19:00 and 00:00.
I don't have any experience about scripts etc. I did some research to configure the ingress setting via cronjob or something else but i could't overcome. What kind of solution should i use to make a scheduled task to automatically swap the ingress value at 19:00 and 00:00 ?
Thank you.
edit:
00 19 * * * uci set sqm.eth1.download=19000; uci commit sqm; /etc/init.d/sqm restart
00 00 * * * uci set sqm.eth1.download=48000; uci commit sqm; /etc/init.d/sqm restart
I don't know if it's correct but i did it like this. But i couldn't manage to execute them even cron is enabled.
You might have to use /sbin/uci so CRON knows where the find the binary.
So in essence try:
00 19 * * * /sbin/uci set sqm.eth1.download=19000; /sbin/uci commit sqm; /etc/init.d/sqm restart
00 00 * * * /sbin/uci set sqm.eth1.download=48000; /sbin/uci commit sqm; /etc/init.d/sqm restart
thank you for the reply.
i already tried that one also. but no luck 
maybe try /etc/init.d/sqm stop ; /etc/init.d/sqm start instead of just /etc/init.d/sqm restart?
Did you restart cron after adding those lines? Because that just worked for me with your command (and the modified path to uci). The note under "Scheduled task" in Luci helped me figure that out.
I can execute all these commands one by one via ssh successfully btw. But via cron, it can't even commit the setting. Can't see any changes via luci or the file itself.
I can't manage to trigger the command lines via cron.
I also tried the basic reboot command in the wiki also. I couldn't make that work also.
Does any command via cron work? If you set the command: logger "cron test" you should see two message types in your log if it works:
Thu May 28 14:14:00 2020 cron.info crond[920]: USER root pid 472 cmd logger "a"; logger "b"; logger "c"
Thu May 28 14:14:00 2020 user.notice root: a
Thu May 28 14:14:00 2020 user.notice root: b
Thu May 28 14:14:00 2020 user.notice root: c
For your command this is what I got back in the logs, where I restarted crond after modifying the crontab:
Thu May 28 14:22:47 2020 cron.info crond[694]: crond (busybox 1.30.1) started, log level 8
Thu May 28 14:23:00 2020 cron.info crond[694]: USER root pid 701 cmd /sbin/uci set sqm.eth1.download=19000; /sbin/uci commit sqm; /etc/init.d/sqm restart
Thu May 28 14:23:01 2020 user.notice SQM: Stopping SQM on pppoe-wan
Thu May 28 14:23:01 2020 user.notice SQM: ifb associated with interface pppoe-wan: ifb4pppoe-wan
Can you please exactly write what command should i paste to crontab for testing?
if you don't have anything in your cron tab, you will need to restart cron from what I can remember.
I would also use something like the following so you don't have to disable/enable SQM every change: (replacing your settings with mine of course)
tc qdisc change root dev ifb4eth0.1 cake bandwidth 3600Kbit dual-dsthost nat
overhead 32 ingress
You can find your settings like so: tc -s qdisc
Not sure if this is the absolute best method, but it works for the scripts I use, and also for manual adjustment. Thankfully my ISP finally enabled DHCP and I was able to get rid of some overhead.
Changing /etc/config/sqm is helpful if due to an hotplug event SQM restarts itself. But both techniques can be combined, just replace the /etc/init.d/sqm invocation with the TC stanza....
Thank you so much for your reply.
I restarted cron service every time i make changes in cron tab. I couldn't even make it trigger the simple reboot command at a specific time.
I was using OpenWrt 19.07.3 r11063-85e04e9f46 / LuCI openwrt-19.07 branch git-20.136.49537-fb2f363 with Kernel 4.14.180 for 1 week. Today i've flashed my old version of OpenWrt (Snapshot with kernel 5.4) to try with it. Cron successfully executed the commands without a hassle. There must be something with the other firmware.
About your command line;
I'm not familiar about programming and these commands. It took 5-6 hours of research to prepare my cron command 
I did execute the "tc -s qdisc" and the part of the log you mentioned is like this;
qdisc cake 800a: dev ifb4eth0.2 root refcnt 2 bandwidth 19Mbit besteffort triple -isolate nonat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 22
What is the proper command according to this?
I'm sorry but can you be more specific if it's possible? Which technique should i use? What do you exactly mean by combining? 