aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-10-06 23:29:41 +0100
committerJustin Clark-Casey (justincc)2014-11-25 23:18:39 +0000
commit1d33a40f59fc15bd85004cc68e802a0b274dad30 (patch)
tree0c8e3ed0119f6201adb167e07961b1d28cf9cdad /OpenSim/Region/ClientStack/Linden
parentMove information about "server agent rate" throttles into "show server thrott... (diff)
downloadopensim-SC_OLD-1d33a40f59fc15bd85004cc68e802a0b274dad30.zip
opensim-SC_OLD-1d33a40f59fc15bd85004cc68e802a0b274dad30.tar.gz
opensim-SC_OLD-1d33a40f59fc15bd85004cc68e802a0b274dad30.tar.bz2
opensim-SC_OLD-1d33a40f59fc15bd85004cc68e802a0b274dad30.tar.xz
Add "debug lludp set scene-throttle-max <value>" console command to allow us to potentially set the scene max throttle on the fly.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs10
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs36
2 files changed, 40 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 9dfe0e9..8ca0b1f 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -243,15 +243,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
243 /// <summary>Incoming packets that are awaiting handling</summary> 243 /// <summary>Incoming packets that are awaiting handling</summary>
244 private OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>(); 244 private OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>();
245 245
246 /// <summary></summary>
247 //private UDPClientCollection m_clients = new UDPClientCollection();
248 /// <summary>Bandwidth throttle for this UDP server</summary> 246 /// <summary>Bandwidth throttle for this UDP server</summary>
249 protected TokenBucket m_throttle; 247 public TokenBucket Throttle { get; private set; }
250 248
251 /// <summary> 249 /// <summary>
252 /// Gets the maximum total drip rate allowed to all clients. 250 /// Gets the maximum total drip rate allowed to all clients.
253 /// </summary> 251 /// </summary>
254 public long MaxTotalDripRate { get { return m_throttle.RequestedDripRate; } } 252 public long MaxTotalDripRate { get { return Throttle.RequestedDripRate; } }
255 253
256 /// <summary>Bandwidth throttle rates for this UDP server</summary> 254 /// <summary>Bandwidth throttle rates for this UDP server</summary>
257 public ThrottleRates ThrottleRates { get; private set; } 255 public ThrottleRates ThrottleRates { get; private set; }
@@ -449,7 +447,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
449// = new TokenBucket( 447// = new TokenBucket(
450// string.Format("server throttle bucket for {0}", Scene.Name), null, sceneThrottleBps); 448// string.Format("server throttle bucket for {0}", Scene.Name), null, sceneThrottleBps);
451 449
452 m_throttle = new TokenBucket("server throttle bucket", null, sceneThrottleBps); 450 Throttle = new TokenBucket("server throttle bucket", null, sceneThrottleBps);
453 451
454 ThrottleRates = new ThrottleRates(configSource); 452 ThrottleRates = new ThrottleRates(configSource);
455 453
@@ -1761,7 +1759,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1761 { 1759 {
1762 if (!Scene.TryGetClient(agentID, out client)) 1760 if (!Scene.TryGetClient(agentID, out client))
1763 { 1761 {
1764 LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); 1762 LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, Throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
1765 1763
1766 client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); 1764 client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
1767 client.OnLogout += LogoutHandler; 1765 client.OnLogout += LogoutHandler;
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
index 438331a..f0f186a 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
@@ -156,6 +156,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
156 m_console.Commands.AddCommand( 156 m_console.Commands.AddCommand(
157 "Debug", 157 "Debug",
158 false, 158 false,
159 "debug lludp set",
160 "debug lludp set <param> <value>",
161 "Set a parameter for the server.",
162 "Only current setting is 'scene-throttle-max' which sets the current max cumulative kbit/s provided for this scene to clients",
163 HandleSetCommand);
164
165 m_console.Commands.AddCommand(
166 "Debug",
167 false,
159 "debug lludp toggle agentupdate", 168 "debug lludp toggle agentupdate",
160 "debug lludp toggle agentupdate", 169 "debug lludp toggle agentupdate",
161 "Toggle whether agentupdate packets are processed or simply discarded.", 170 "Toggle whether agentupdate packets are processed or simply discarded.",
@@ -363,6 +372,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP
363 }); 372 });
364 } 373 }
365 374
375 private void HandleSetCommand(string module, string[] args)
376 {
377 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
378 return;
379
380 if (args.Length != 5)
381 {
382 MainConsole.Instance.OutputFormat("Usage: debug lludp set <param> <value>");
383 return;
384 }
385
386 string param = args[3];
387 string rawValue = args[4];
388
389 int newValue;
390
391 if (param == "scene-throttle-max")
392 {
393 if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, rawValue, out newValue))
394 return;
395
396 m_udpServer.Throttle.RequestedDripRate = newValue * 8 * 1000;
397 }
398
399 m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name);
400 }
401
366 private void HandlePacketCommand(string module, string[] args) 402 private void HandlePacketCommand(string module, string[] args)
367 { 403 {
368 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene) 404 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)