QoS speed depending on time

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2  Next
Author Message
staff1703
DD-WRT Novice


Joined: 04 Dec 2010
Posts: 13

PostPosted: Sun Dec 05, 2010 21:54    Post subject: QoS speed depending on time Reply with quote
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?

Thanks in advance for any help...
Sponsor
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Thu Dec 09, 2010 5:38    Post subject: Reply with quote
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)
staff1703
DD-WRT Novice


Joined: 04 Dec 2010
Posts: 13

PostPosted: Thu Dec 09, 2010 21:22    Post subject: Reply with quote
Thanks - that's helpful
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Fri Dec 10, 2010 11:42    Post subject: Reply with quote
staff1703 wrote:
Quote:
*/6 1-17 * * * root /usr/sbin/svqos stop


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)
staff1703
DD-WRT Novice


Joined: 04 Dec 2010
Posts: 13

PostPosted: Fri Dec 10, 2010 20:28    Post subject: Reply with quote
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...
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Sat Dec 11, 2010 9:51    Post subject: Reply with quote
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)
staff1703
DD-WRT Novice


Joined: 04 Dec 2010
Posts: 13

PostPosted: Sat Dec 11, 2010 18:08    Post subject: Reply with quote
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.
staff1703
DD-WRT Novice


Joined: 04 Dec 2010
Posts: 13

PostPosted: Mon Dec 13, 2010 18:02    Post subject: Reply with quote
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;
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Mon Dec 13, 2010 21:01    Post subject: Reply with quote
staff1703 wrote:
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)
thefix0r
DD-WRT Novice


Joined: 15 Dec 2010
Posts: 20

PostPosted: Wed Dec 15, 2010 21:57    Post subject: DDWRT QoS=sh^& Reply with quote
DDwrt QoS=Shat, it doesnt work, period, it outta just be removed.

I used Queus in Mikrotik, now that actually works.

Ive tried using QoS on MANY ddwrt routers and it just doesnt work. Doesnt do a damn thing as far as I can tell.
staff1703
DD-WRT Novice


Joined: 04 Dec 2010
Posts: 13

PostPosted: Thu Dec 16, 2010 22:52    Post subject: Reply with quote
phuzi0n wrote:
Because you set the interface to LAN&WLAN which should almost never be used. See the QoS wiki for more info.

QoS Tutorial wrote:
if you want to use LAN&WLAN then change "`get_wanface`" to "br0".


I don't think so - I have exactly `get_wanface` in my cron schedule so as far as I understand the tutorial gives me normal WAN side QoS



EDIT

OK there is a mistake in tutorial in the time qos section - there should be `get_waniface`
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Fri Dec 17, 2010 4:11    Post subject: Reply with quote
staff1703 wrote:
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...

HTB:
/usr/sbin/svqos [downlink] [uplink] [interface] [MTU] [imq #]

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)
staff1703
DD-WRT Novice


Joined: 04 Dec 2010
Posts: 13

PostPosted: Fri Dec 24, 2010 19:20    Post subject: Reply with quote
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?
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Sun Dec 26, 2010 6:45    Post subject: Reply with quote
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)
[pl]sajmon
DD-WRT Novice


Joined: 04 Nov 2011
Posts: 2

PostPosted: Sat Nov 12, 2011 11:24    Post subject: Reply with quote
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
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum