Community discussions

MikroTik App
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Rate Limit Setting

Wed Aug 07, 2013 10:06 am

I m using Hotspot i want to assign Brust rate to the users

i want that users will start download a file on 256k/1800k and after 30 second the move back to limit at 256k/900k

i have tried

256k/900k 256k/1800k 256k/1200k 30/30 8 256k/700k this on rate limit. but this way variate the speed again and again.

when i start download then speed start from 1800k and after few second it goes to 900k but again after few seconds it goes back to 1800k then again down

But i want to use brust for few second and then normal rate should be applied.

user start downloading at 1800k and after 30 second it must be stay on 900k it should not increase again on the same downloading session.

how can i do that
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Re: Rate Limit Setting

Thu Aug 08, 2013 12:07 pm

Bump......... no reply yet
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Re: Rate Limit Setting

Fri Aug 09, 2013 10:59 pm

What is This? can i know? its not my problem solution
 
galaxynet
Long time Member
Long time Member
Posts: 646
Joined: Fri Dec 17, 2004 2:52 pm
Contact:

Re: Rate Limit Setting

Mon Aug 12, 2013 3:49 pm

farazhamzaa -
I know what you are seeing is confusing in regards to the Burst limitation.

Read this and see if it helps you understand what all the settings mean. It also has a graphical representation of what is happening. If that does not help post back and I'll see if I can add some additional explanations for you.

Thom

http://wiki.mikrotik.com/wiki/Manual:Queues_-_Burst
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Re: Rate Limit Setting

Tue Aug 13, 2013 9:32 am

i have read the above link
but my english is bit poor so points are not clear to me

i think they are saying that brust will work on download start and work till brust time. and then brust will switch off and remaining file download speed will goes to actual rate.

and i m also trying to do so...... if a person start download 100 MB file . then file start download on Brust limit 150Kbps transfer rate. and then after 20 secondes rate limit will goes back to actual rate that is 100 Kbps and actual rate continue till the end of this file.

again if the same person start one more file then transfer rate will act agian the same as i said above. start from 150 kbps and after 20 second goes to 100 kbps
 
galaxynet
Long time Member
Long time Member
Posts: 646
Joined: Fri Dec 17, 2004 2:52 pm
Contact:

Re: Rate Limit Setting

Tue Aug 13, 2013 4:40 pm

Farazhamzaa
Your requirements:

256k/1800k and after 30 second the move back to limit at 256k/900k

Using your initial example of; 256k/1800k and after 30 second the move back to limit at 256k/900k, let's look at what should happen.

What I understand your setup to be is Limit-at=256k Max-limit=900k Burst-limit=1800K, you didn't mention a Burst-threshold so I have it set at Burst-threshold=800k, Burst-time=30 (seconds).

First, Average Rate is calculated at 1/16th of burst time, so 30/16=1.875 seconds the average throughput is calculated.

If for this discussion we say that the client connection was unused for the previous minute, then;

longest-burst-time = burst-threshold * burst-time / burst-limit, substituting the numbers in gives us;
longest-burst-time = 800000 * 30 / 1800000
longest-burst-time = 24000000/ 1800000
longest-burst-time = 13.3 seconds is the maximum burst time under a full load for this client.

So for 13.3 seconds the client will get the full 1800k download speed, after that as long as the client's download stays above the burst-threshold then the client will only get the Max-limit of 900k. If at anytime the client's average-rate of download should drop below the Burst-threshold then the client could get a higher download speed for a period of time based on this;

average-rate as calculated every 1/16 of Burst-time (1.875 seconds in your case), so if average-rate < (less than) Burst-threshold = bursting allowed. If at anytime average-rate is '=' or > (greater than) Burst-threshold then bursting is 'off' and the download is held at 900k.

It does not matter the number of data streams a client has started, if you mark their connection and packets then use the packet mark in your queue then ALL of their traffic will be controlled by the queue you set up for them.

So you want them to burst for 30 seconds and then not go above the Max-limit while actively downloading something...then lets do the math.

First bit of advice, use numbers based on multiples of 16 for your Burst-time, i.e., 8, 16, 32, 48, 64, 80, etc.
Be aware - the longer the Burst-time is the longer the period that is used to compare average-rate to burst-threshold. Using your 30 second burst-time we came up with a 1.875 second interval for averaging the rate, if we choose say 48 seconds then we get 3 seconds for the time to use to average out the rate.....

our formula: longest-burst-time = burst-threshold * burst-time / burst-limit

we want; 30 seconds = burst-threshold * burst-time / burst-limit

30 seconds = 800000 * 64 / 1800000
30 seconds = 51200000 / 1800000
30 seconds = 28.45 seconds = pretty close to 30 seconds. Downside is our average-rate calculation time is 4 seconds. So only every 4 seconds will the average-rate get calculated which means if the client's average rate should drop below our burst-threshold of 800k then bursting will be turned back 'on' and they could get 1800k for the next 4 seconds until the average-rate is calculated again......

Ok - so what if we set the burst-threshold lower...using our formula:
longest-burst-time = burst-threshold * burst-time / burst-limit
longest-burst-time = 512000 * 64 / 1800000
longest-burst-time = 32768000 / 1800000
longest-burst-time = 18.2 seconds hmmm....about half of what we wanted to give the client, still have a 4 seconds average-rate calculation, the good thing is that their average-rate would have to be lower than 512k for the burst switch to turn on, so maybe this isn't so bad after all......

Ok farazhamzaa I've given you a couple of good examples on how to apply the settings. Please experiment with the new knowledge and let us all know here on the forum what you came up with and your reasoning for your decision.

Thom
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Re: Rate Limit Setting

Tue Aug 13, 2013 8:23 pm

Thank you so much thom for building my concept about brust. and your guidance realy help me

Sir after reading i set my profile rate limit as

256k/900k 256k/1800k 256k/500k 60/60 8 256k/256k

and then start check by downloading a 1 GB file from internet

starting 40 second i got 1800k speed as brust limit after 40 second speed comes to acual rate 900k i didnt stop the downloading file and let it continue to dowload just to observe the speed.

after 1m:50s it goes again to 1800k. and then again after 17 second speed comes normal to 900k. then again after 17 second it goes up to 1800k

i dont know why it again and again touch to brust limit.while downloading a big file without pausing. even i set brust threshold too low which cannot be touch while downloading a single file.

sir what you say about this?
 
galaxynet
Long time Member
Long time Member
Posts: 646
Joined: Fri Dec 17, 2004 2:52 pm
Contact:

Re: Rate Limit Setting

Tue Aug 13, 2013 9:01 pm

farazhamzaa - What type of queue are you using? pfifo, pcq, or what?

The 17 second period you are seeing is 'longest-burst-time' in action. longest-burst-time = burst-threshold * burst-time / burst-limit, substituting your numbers in gives us;
longest-burst-time = 500000 * 60 / 1800000
longest-burst-time = 30000000 / 1800000
longest-burst-time = 16.67 seconds

Your average-rate calculation time is 1/16 of the burst-time so, your numbers 60/16=3.75 seconds the average rate is calculated.

I usually see the kind of 'odd' behaviour you are describing when folks use PCQ type queue instead of a pfifo type queue.

If it were me, I'd be sure to change the queue type to a pfifo. Make sure it has some capacity...not 2 packets but more like 50 to 100 packets.

Thom
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Re: Rate Limit Setting

Thu Aug 15, 2013 11:59 am

i m using Hotspot and Queue is default hotspot i think pfifo is using. i didnt create any queue else default hotspot.

and i use Internet download manager to check the brust behaviour and i think it creats 9 to 10 links

well Sir, isnt possible what i want to do?

i just want to set a time for brust i mean 1800k download will continue till 30 second and after it user will get 900k and willnot brust again on the same downloading session.
 
galaxynet
Long time Member
Long time Member
Posts: 646
Joined: Fri Dec 17, 2004 2:52 pm
Contact:

Re: Rate Limit Setting

Thu Aug 15, 2013 4:02 pm

farazhamzaa -
Hotspot default queue type is hotspot-default and that is an SFQ type..... I recommend you set the queue type to 'default'. Then go to the 'queue type' tab and open default and make sure it has 50 to 100 packets as the size.

This should make your queue scheme work much closer to what you want. With bursting on you are never going to get it to just do 1800k for 30 seconds and then never burst again until the download session is done, you can get close, as we have already seen above by manipulating burst time, burst-limit, etc. Bursting was meant to allow higher download speeds for short periods of time, mostly to take advantage of unused bandwidth to speed up access with out causing other users issues. If you had multiple users trying to use your system at the same time and used bursting queues you would see that the second and thrid bursts may or may not happen, depending on what bandwidth is still available, how much a user used during the burst period, etc.....

In other words all you are going to be able to do is approximate your desired outcome. I've used these systems for years, and although there are a few quirky things (like this burst-time setting) I have found that I can pretty much do anything I need to because the software is so flexible.....

So farazhamzaa, play with the settings we have discussed, get more users on your hotspot, change the queue type, and see if all of that gets you closer to your goal.

Thom

Who is online

Users browsing this forum: 4l4R1, adwlodaro, hazem and 223 guests