aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
diff options
context:
space:
mode:
authorMic Bowman2014-12-30 10:39:14 -0800
committerMic Bowman2014-12-30 10:39:14 -0800
commitc06100c31f9c0a2785c131a6100ecce823ed0f38 (patch)
tree22061b821c871ed5b6475aad1f8989c2e39dad50 /OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
parentFix the throttle tests. Remove the hardcoded constant multipliers and (diff)
downloadopensim-SC-c06100c31f9c0a2785c131a6100ecce823ed0f38.zip
opensim-SC-c06100c31f9c0a2785c131a6100ecce823ed0f38.tar.gz
opensim-SC-c06100c31f9c0a2785c131a6100ecce823ed0f38.tar.bz2
opensim-SC-c06100c31f9c0a2785c131a6100ecce823ed0f38.tar.xz
Another technique inspired by some of the newer flow control algorithms... rather
than drop exponentially to 0 (and then adjust up for the minimum flow), drop on the delta between current rate and the minimum rate. This should smooth the fallback to minimum.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs28
1 files changed, 17 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
index e67c0f5..38ae760 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
@@ -395,16 +395,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
395 /// The minimum rate for adaptive flow control. 395 /// The minimum rate for adaptive flow control.
396 /// </summary> 396 /// </summary>
397 protected Int64 m_minimumFlow = 32000; 397 protected Int64 m_minimumFlow = 32000;
398 public Int64 MinimumFlow
399 {
400 get { return m_minimumFlow; }
401 set
402 {
403 m_minimumFlow = value;
404 TargetDripRate = Math.Max(m_minimumFlow, TargetDripRate);
405 AdjustedDripRate = Math.Max(m_minimumFlow, AdjustedDripRate);
406 }
407 }
408 398
409 /// <summary> 399 /// <summary>
410 /// Constructor for the AdaptiveTokenBucket class 400 /// Constructor for the AdaptiveTokenBucket class
@@ -441,7 +431,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
441 "[ADAPTIVEBUCKET] drop {0} by {1} expired packets for {2}", 431 "[ADAPTIVEBUCKET] drop {0} by {1} expired packets for {2}",
442 AdjustedDripRate, packets, Identifier); 432 AdjustedDripRate, packets, Identifier);
443 433
444 AdjustedDripRate = (Int64) (AdjustedDripRate / Math.Pow(2,packets)); 434 // AdjustedDripRate = (Int64) (AdjustedDripRate / Math.Pow(2,packets));
435
436 // Compute the fallback solely on the rate allocated beyond the minimum, this
437 // should smooth out the fallback to the minimum rate
438 AdjustedDripRate = m_minimumFlow + (Int64) ((AdjustedDripRate - m_minimumFlow) / Math.Pow(2, packets));
445 } 439 }
446 } 440 }
447 441
@@ -454,5 +448,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
454 if (AdaptiveEnabled) 448 if (AdaptiveEnabled)
455 AdjustedDripRate = AdjustedDripRate + packets * LLUDPServer.MTU; 449 AdjustedDripRate = AdjustedDripRate + packets * LLUDPServer.MTU;
456 } 450 }
451
452 /// <summary>
453 /// Adjust the minimum flow level for the adaptive throttle, this will drop adjusted
454 /// throttles back to the minimum levels
455 /// <param>minDripRate--the new minimum flow</param>
456 /// </summary>
457 public void ResetMinimumAdaptiveFlow(Int64 minDripRate)
458 {
459 m_minimumFlow = minDripRate;
460 TargetDripRate = m_minimumFlow;
461 AdjustedDripRate = m_minimumFlow;
462 }
457 } 463 }
458} \ No newline at end of file 464} \ No newline at end of file