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.
avinationmerge
UbitUmarov 2014-08-28 22:26:03 +01:00
parent 894b5c10c6
commit 986863a0cd
2 changed files with 11 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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.
/// </summary>
protected const Int64 m_minimumFlow = m_minimumDripRate * 15;
protected const Int64 m_minimumFlow = m_minimumDripRate;
// <summary>
// The maximum rate for flow control. Drip rate can never be