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.
This commit is contained in:
Justin Clark-Casey (justincc)
2014-08-19 00:11:04 +01:00
parent b375f86f11
commit 84cea46c10
3 changed files with 288 additions and 5 deletions

View File

@@ -650,8 +650,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (HasUpdates(m_categories))
{
// Asynchronously run the callback
Util.FireAndForget(FireQueueEmpty, categories);
if (!m_udpServer.OqrEngine.IsRunning)
{
// Asynchronously run the callback
Util.FireAndForget(FireQueueEmpty, categories);
}
else
{
m_udpServer.OqrEngine.QueueRequest(this, categories);
}
}
else
{
@@ -670,7 +677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="o">Throttle categories to fire the callback for,
/// stored as an object to match the WaitCallback delegate
/// signature</param>
private void FireQueueEmpty(object o)
public void FireQueueEmpty(object o)
{
// m_log.DebugFormat("[LLUDPCLIENT]: FireQueueEmpty for {0} in {1}", AgentID, m_udpServer.Scene.Name);