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
parent
894b5c10c6
commit
986863a0cd
|
@ -616,6 +616,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
// No packets in this queue. Fire the queue empty callback
|
// No packets in this queue. Fire the queue empty callback
|
||||||
// if it has not been called recently
|
// if it has not been called recently
|
||||||
|
|
||||||
|
bucket.Tick(); // tick the bucket
|
||||||
emptyCategories |= CategoryToFlag(i);
|
emptyCategories |= CategoryToFlag(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,6 +312,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
// Determine the interval over which we are adding tokens, never add
|
// Determine the interval over which we are adding tokens, never add
|
||||||
// more than a single quantum of tokens
|
// 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);
|
Int32 deltaMS = Math.Min(Util.EnvironmentTickCountSubtract(m_lastDrip), m_ticksPerQuantum);
|
||||||
m_lastDrip = Util.EnvironmentTickCount();
|
m_lastDrip = Util.EnvironmentTickCount();
|
||||||
|
|
||||||
|
@ -322,6 +325,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
Deposit(deltaMS * DripRate / m_ticksPerQuantum);
|
Deposit(deltaMS * DripRate / m_ticksPerQuantum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Tick()
|
||||||
|
{
|
||||||
|
m_lastDrip = Util.EnvironmentTickCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AdaptiveTokenBucket : TokenBucket
|
public class AdaptiveTokenBucket : TokenBucket
|
||||||
|
@ -333,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// packet per second. Open the throttle to 15 packets per second
|
/// packet per second. Open the throttle to 15 packets per second
|
||||||
/// or about 160kbps.
|
/// or about 160kbps.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected const Int64 m_minimumFlow = m_minimumDripRate * 15;
|
protected const Int64 m_minimumFlow = m_minimumDripRate;
|
||||||
|
|
||||||
// <summary>
|
// <summary>
|
||||||
// The maximum rate for flow control. Drip rate can never be
|
// The maximum rate for flow control. Drip rate can never be
|
||||||
|
|
Loading…
Reference in New Issue