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