Add "debug lludp set scene-throttle-max <value>" console command to allow us to potentially set the scene max throttle on the fly.
parent
a5eabdade3
commit
1d33a40f59
|
@ -243,15 +243,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// <summary>Incoming packets that are awaiting handling</summary>
|
/// <summary>Incoming packets that are awaiting handling</summary>
|
||||||
private OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>();
|
private OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>();
|
||||||
|
|
||||||
/// <summary></summary>
|
|
||||||
//private UDPClientCollection m_clients = new UDPClientCollection();
|
|
||||||
/// <summary>Bandwidth throttle for this UDP server</summary>
|
/// <summary>Bandwidth throttle for this UDP server</summary>
|
||||||
protected TokenBucket m_throttle;
|
public TokenBucket Throttle { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the maximum total drip rate allowed to all clients.
|
/// Gets the maximum total drip rate allowed to all clients.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long MaxTotalDripRate { get { return m_throttle.RequestedDripRate; } }
|
public long MaxTotalDripRate { get { return Throttle.RequestedDripRate; } }
|
||||||
|
|
||||||
/// <summary>Bandwidth throttle rates for this UDP server</summary>
|
/// <summary>Bandwidth throttle rates for this UDP server</summary>
|
||||||
public ThrottleRates ThrottleRates { get; private set; }
|
public ThrottleRates ThrottleRates { get; private set; }
|
||||||
|
@ -449,7 +447,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
// = new TokenBucket(
|
// = new TokenBucket(
|
||||||
// string.Format("server throttle bucket for {0}", Scene.Name), null, sceneThrottleBps);
|
// string.Format("server throttle bucket for {0}", Scene.Name), null, sceneThrottleBps);
|
||||||
|
|
||||||
m_throttle = new TokenBucket("server throttle bucket", null, sceneThrottleBps);
|
Throttle = new TokenBucket("server throttle bucket", null, sceneThrottleBps);
|
||||||
|
|
||||||
ThrottleRates = new ThrottleRates(configSource);
|
ThrottleRates = new ThrottleRates(configSource);
|
||||||
|
|
||||||
|
@ -1761,7 +1759,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
if (!Scene.TryGetClient(agentID, out client))
|
if (!Scene.TryGetClient(agentID, out client))
|
||||||
{
|
{
|
||||||
LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
|
LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, Throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
|
||||||
|
|
||||||
client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
|
client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
|
||||||
client.OnLogout += LogoutHandler;
|
client.OnLogout += LogoutHandler;
|
||||||
|
|
|
@ -153,6 +153,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
"Only current setting is 'adaptive' which must be 'true' or 'false'",
|
"Only current setting is 'adaptive' which must be 'true' or 'false'",
|
||||||
HandleThrottleSetCommand);
|
HandleThrottleSetCommand);
|
||||||
|
|
||||||
|
m_console.Commands.AddCommand(
|
||||||
|
"Debug",
|
||||||
|
false,
|
||||||
|
"debug lludp set",
|
||||||
|
"debug lludp set <param> <value>",
|
||||||
|
"Set a parameter for the server.",
|
||||||
|
"Only current setting is 'scene-throttle-max' which sets the current max cumulative kbit/s provided for this scene to clients",
|
||||||
|
HandleSetCommand);
|
||||||
|
|
||||||
m_console.Commands.AddCommand(
|
m_console.Commands.AddCommand(
|
||||||
"Debug",
|
"Debug",
|
||||||
false,
|
false,
|
||||||
|
@ -363,6 +372,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HandleSetCommand(string module, string[] args)
|
||||||
|
{
|
||||||
|
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (args.Length != 5)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.OutputFormat("Usage: debug lludp set <param> <value>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string param = args[3];
|
||||||
|
string rawValue = args[4];
|
||||||
|
|
||||||
|
int newValue;
|
||||||
|
|
||||||
|
if (param == "scene-throttle-max")
|
||||||
|
{
|
||||||
|
if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, rawValue, out newValue))
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_udpServer.Throttle.RequestedDripRate = newValue * 8 * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name);
|
||||||
|
}
|
||||||
|
|
||||||
private void HandlePacketCommand(string module, string[] args)
|
private void HandlePacketCommand(string module, string[] args)
|
||||||
{
|
{
|
||||||
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
|
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
|
||||||
|
|
Loading…
Reference in New Issue