Posted: Sun Dec 05, 2010 21:54 Post subject: QoS speed depending on time
Hi,
I've got a weird question. I changed my ISP and now I've got "Happy hours" and then my downlink is doubled. It's very sad for me that it's wasting because of QoS that limits my bandwidth to the "day speed". I could turn the service off, but I actually need it for my VoIP phone...
Is it possible to make some cron script that changes QoS speed depending on time of day?
http://www.dd-wrt.com/wiki/index.php/Qos#Time_Based_QoS _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Hi I've got a question about cron job for my problem. I thinl I should do something like this:
0 23 * * * root /usr/sbin/svqos 500 16000 `get_wanface` `nvram get wan_mtu` 0
0 10 * * * root /usr/sbin/svqos 500 8000 `get_wanface` `nvram get wan_mtu` 0
Then I should get from 23 to 10 oclock fast speed and from 10 to 23 oclock the lower speed. I just wonder if I shouldn't make stop command to work it properly. What do you think about it?
And second question: why did you use "*/6 1-17 * * *" ? You just need to stop it once, and as far as I get it, in this method you would send stop signal every 6 minutes from 1 till 17...
Thanks for help in advance...
The reasoning for /6 is that if the WAN goes down for any reason during the alternate settings time span then the alternate setting will need to get reapplied when the WAN comes back up. You don't need to stop it to change the settings because changing the settings will cause all the queues to be wiped and rebuilt anyways.
Because of this it's a lot harder to suggest how often to try to apply the alternate settings while they're supposed to be active because doing so will cause a few seconds of traffic fluctuation. You might want to write a firewall script that checks what time it is and sets the appropriate settings to handle the problem of the WAN possibly going down. _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
So maybe it would be a good idea to do something like:
1 23 * * * root /usr/sbin/svqos `nvram get wshaper_uplink` 16000 `get_wanface` `nvram get wan_mtu` 0
1 10 * * * root /usr/sbin/svqos `nvram get wshaper_uplink` 8000 `get_wanface` `nvram get wan_mtu` 0
*/5 23-10 * * * root nvram set wshaper_downlink=16000
*/5 10-23 * * * root nvram set wshaper_downlink=8000
I don't want to play with that on living machine, that's why I'm asking first...
I'm just curious if svqos checks what is written in nvram during work, or just during the initiation? In the first case I can secure he electric malfunction. In the second case I don't know how to do it...
Yeah that seems like a reasonable easy solution. The only problem is that it doesn't handle router reboots because the firmware only checks the nvram variables when it's setting up the queues using the same script the cron job runs. If you want to handle reboots too then do this but beware that it will add 2 writes to your flash every day which will wear it down sooner.
1 23 * * * root /usr/sbin/svqos `nvram get wshaper_uplink` 16000 `get_wanface` `nvram get wan_mtu` 0; nvram set wshaper_downlink=16000; nvram commit
1 10 * * * root /usr/sbin/svqos `nvram get wshaper_uplink` 8000 `get_wanface` `nvram get wan_mtu` 0; nvram set wshaper_downlink=8000; nvram commit _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
I decided to deploy the version without commit: I make reboots very occasionally (especially in the middle of the night), and electrics malfunction are very rare.
One more note: On my tp-link the qos runned like above has inverted speeds - the uplink is 8000 and the downlink is 500 (yeah it hurts). So it should be like this:
1 23 * * * root /usr/sbin/svqos 16000 `nvram get wshaper_uplink` `get_wanface` `nvram get wan_mtu` 0; nvram set wshaper_downlink=16000;
1 10 * * * root /usr/sbin/svqos 8000 `nvram get wshaper_uplink` `get_wanface` `nvram get wan_mtu` 0; nvram set wshaper_downlink=8000;
One more note: On my tp-link the qos runned like above has inverted speeds - the uplink is 8000 and the downlink is 500 (yeah it hurts).
Because you set the interface to LAN&WLAN which should almost never be used. See the QoS wiki for more info. _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
OK there is a mistake in tutorial in the time qos section - there should be `get_waniface`
That's no mistake and your change is not a valid command. However I was mistaken about the order of the arguments for the script, I forgot that the HTB and HFSC scripts have their uplink and downlink argument order switched for some idiotic reason which I reported years ago...
HFSC:
/usr/sbin/svqos2 [uplink] [downlink] [interface] [MTU] [imq #] _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
There is another problem now. I just get to the conclusion that this QoS is really sh*tty! When I turn it on (even through the www i/f) I can't get even 50% of maximum bandwidth. It's the same on HTB and HFSC. Are there any other apps that can give me this functionality and they just don't cut my bandwidth?
That's usually a case of a slow CPU not being able to handle the load. What exact model do you have and what rate is your connection? _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
I have a small question
I wrote the script, everything is as it should be but I have no idea how to restart the service to apply the new QoS values. Can someone hint ... I do not want to use the reboot
Code:
59 11 * * * root /usr/sbin/svqos `get_wanface` `nvram get wan_mtu` 0;nvram set wshaper_uplink=460; nvram set wshaper_downlink=7372; nvram set default_downlevel=6400; nvram set default_uplevel=409; nvram commit
1 0 * * * root /usr/sbin/svqos `get_wanface` `nvram get wan_mtu` 0;nvram set wshaper_uplink=460; nvram set wshaper_downlink=14745; nvram set default_downlevel=13107; nvram set default_uplevel=409; nvram commit