From 986863a0cd9cf79111865cee2729aa6edd7a8ffa Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 28 Aug 2014 22:26:03 +0100 Subject: try to reduce insane high data rate udp bursts. This needs testing on a region with a lot of contents. Should not affect much average rates. --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 2 ++ OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index 89a9401..e760513 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -616,6 +616,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // No packets in this queue. Fire the queue empty callback // if it has not been called recently + + bucket.Tick(); // tick the bucket emptyCategories |= CategoryToFlag(i); } } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs index 2a60b48..b1f2236 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs @@ -312,6 +312,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Determine the interval over which we are adding tokens, never add // more than a single quantum of tokens + + // No... add no more than the estimated time between checks + Int32 deltaMS = Math.Min(Util.EnvironmentTickCountSubtract(m_lastDrip), m_ticksPerQuantum); m_lastDrip = Util.EnvironmentTickCount(); @@ -322,6 +325,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP Deposit(deltaMS * DripRate / m_ticksPerQuantum); } + + public void Tick() + { + m_lastDrip = Util.EnvironmentTickCount(); + } } public class AdaptiveTokenBucket : TokenBucket @@ -333,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// packet per second. Open the throttle to 15 packets per second /// or about 160kbps. /// - protected const Int64 m_minimumFlow = m_minimumDripRate * 15; + protected const Int64 m_minimumFlow = m_minimumDripRate; // // The maximum rate for flow control. Drip rate can never be -- cgit v1.1