aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorUbitUmarov2014-08-28 22:26:03 +0100
committerUbitUmarov2014-08-28 22:26:03 +0100
commit986863a0cd9cf79111865cee2729aa6edd7a8ffa (patch)
tree4711c81bbaca6e44ce3bb868dfc500d56d17a63b /OpenSim/Region/ClientStack
parentremove misplaced comment (diff)
downloadopensim-SC_OLD-986863a0cd9cf79111865cee2729aa6edd7a8ffa.zip
opensim-SC_OLD-986863a0cd9cf79111865cee2729aa6edd7a8ffa.tar.gz
opensim-SC_OLD-986863a0cd9cf79111865cee2729aa6edd7a8ffa.tar.bz2
opensim-SC_OLD-986863a0cd9cf79111865cee2729aa6edd7a8ffa.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs10
2 files changed, 11 insertions, 1 deletions
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
616 { 616 {
617 // No packets in this queue. Fire the queue empty callback 617 // No packets in this queue. Fire the queue empty callback
618 // if it has not been called recently 618 // if it has not been called recently
619
620 bucket.Tick(); // tick the bucket
619 emptyCategories |= CategoryToFlag(i); 621 emptyCategories |= CategoryToFlag(i);
620 } 622 }
621 } 623 }
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
312 312
313 // Determine the interval over which we are adding tokens, never add 313 // Determine the interval over which we are adding tokens, never add
314 // more than a single quantum of tokens 314 // more than a single quantum of tokens
315
316 // No... add no more than the estimated time between checks
317
315 Int32 deltaMS = Math.Min(Util.EnvironmentTickCountSubtract(m_lastDrip), m_ticksPerQuantum); 318 Int32 deltaMS = Math.Min(Util.EnvironmentTickCountSubtract(m_lastDrip), m_ticksPerQuantum);
316 m_lastDrip = Util.EnvironmentTickCount(); 319 m_lastDrip = Util.EnvironmentTickCount();
317 320
@@ -322,6 +325,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
322 325
323 Deposit(deltaMS * DripRate / m_ticksPerQuantum); 326 Deposit(deltaMS * DripRate / m_ticksPerQuantum);
324 } 327 }
328
329 public void Tick()
330 {
331 m_lastDrip = Util.EnvironmentTickCount();
332 }
325 } 333 }
326 334
327 public class AdaptiveTokenBucket : TokenBucket 335 public class AdaptiveTokenBucket : TokenBucket
@@ -333,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
333 /// packet per second. Open the throttle to 15 packets per second 341 /// packet per second. Open the throttle to 15 packets per second
334 /// or about 160kbps. 342 /// or about 160kbps.
335 /// </summary> 343 /// </summary>
336 protected const Int64 m_minimumFlow = m_minimumDripRate * 15; 344 protected const Int64 m_minimumFlow = m_minimumDripRate;
337 345
338 // <summary> 346 // <summary>
339 // The maximum rate for flow control. Drip rate can never be 347 // The maximum rate for flow control. Drip rate can never be