diff options
author | Justin Clark-Casey (justincc) | 2014-08-19 00:11:04 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-08-19 00:17:12 +0100 |
commit | 84cea46c10e3f44c4d869d439a01ca7f80b56ece (patch) | |
tree | 3dbbbebb44fba4c2ac45046ed698752decf79d42 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |
parent | Make LLUDPServer.Scene publicly gettable/privately settable instead of protec... (diff) | |
download | opensim-SC-84cea46c10e3f44c4d869d439a01ca7f80b56ece.zip opensim-SC-84cea46c10e3f44c4d869d439a01ca7f80b56ece.tar.gz opensim-SC-84cea46c10e3f44c4d869d439a01ca7f80b56ece.tar.bz2 opensim-SC-84cea46c10e3f44c4d869d439a01ca7f80b56ece.tar.xz |
Add experimental OutgoingQueueRefillEngine to handle queue refill processing on a controlled number of threads rather than the threadpool.
Disabled by default. Currently can only be enabled with console "debug lludp oqre start" command, though this can be started and stopped whilst simulator is running.
When a connection requires packet queue refill processing (used to populate queues with entity updates, entity prop updates and image queue updates), this is done via Threadpool requests.
However, with a very high number of connections (e.g. 100 root + 300 child) a very large number of simultaneous requests may be causing performance issues.
This commit adds an experimental engine for processing these requests from a queue with a persistent thread instead.
Unlike inbound processing, there are no network requests in this processing that might hold the thread up for a long time.
Early implementation - currently only one thread which may (or may not) get overloaded with requests. Added for testing purposes.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 465c86b..3c9bb1b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -355,6 +355,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
355 | /// </summary> | 355 | /// </summary> |
356 | private IClientAPI m_currentIncomingClient; | 356 | private IClientAPI m_currentIncomingClient; |
357 | 357 | ||
358 | /// <summary> | ||
359 | /// Experimental facility to run queue empty processing within a controlled number of threads rather than | ||
360 | /// requiring massive numbers of short-lived threads from the threadpool when there are a high number of | ||
361 | /// connections. | ||
362 | /// </summary> | ||
363 | public OutgoingQueueRefillEngine OqrEngine { get; private set; } | ||
364 | |||
358 | public LLUDPServer( | 365 | public LLUDPServer( |
359 | IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, | 366 | IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, |
360 | IConfigSource configSource, AgentCircuitManager circuitManager) | 367 | IConfigSource configSource, AgentCircuitManager circuitManager) |
@@ -432,6 +439,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
432 | 439 | ||
433 | if (usePools) | 440 | if (usePools) |
434 | EnablePools(); | 441 | EnablePools(); |
442 | |||
443 | OqrEngine = new OutgoingQueueRefillEngine(this); | ||
435 | } | 444 | } |
436 | 445 | ||
437 | public void Start() | 446 | public void Start() |
@@ -469,7 +478,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
469 | 478 | ||
470 | Watchdog.StartThread( | 479 | Watchdog.StartThread( |
471 | OutgoingPacketHandler, | 480 | OutgoingPacketHandler, |
472 | string.Format("Outgoing Packets ({0})", Scene.RegionInfo.RegionName), | 481 | string.Format("Outgoing Packets ({0})", Scene.Name), |
473 | ThreadPriority.Normal, | 482 | ThreadPriority.Normal, |
474 | false, | 483 | false, |
475 | true, | 484 | true, |
@@ -479,7 +488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
479 | 488 | ||
480 | public void Stop() | 489 | public void Stop() |
481 | { | 490 | { |
482 | m_log.Info("[LLUDPSERVER]: Shutting down the LLUDP server for " + Scene.RegionInfo.RegionName); | 491 | m_log.Info("[LLUDPSERVER]: Shutting down the LLUDP server for " + Scene.Name); |
483 | base.StopOutbound(); | 492 | base.StopOutbound(); |
484 | base.StopInbound(); | 493 | base.StopInbound(); |
485 | } | 494 | } |