Add incoming packet async handling engine to queue some inbound udp async requests.

This is to reduce the potential for overload of the threadpool if there are many simultaneous requets in high concurrency situations.
Currently only applied to AvatarProperties and GenericMessage requests.
This commit is contained in:
Justin Clark-Casey (justincc)
2014-11-05 19:02:26 +00:00
parent 1c5c6af274
commit d6c9705a3b
4 changed files with 394 additions and 12 deletions

View File

@@ -363,6 +363,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// </summary>
private IClientAPI m_currentIncomingClient;
/// <summary>
/// Queue some low priority but potentially high volume async requests so that they don't overwhelm available
/// threadpool threads.
/// </summary>
public IncomingPacketAsyncHandlingEngine IpahEngine { get; private set; }
/// <summary>
/// Experimental facility to run queue empty processing within a controlled number of threads rather than
/// requiring massive numbers of short-lived threads from the threadpool when there are a high number of
@@ -454,6 +460,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (usePools)
EnablePools();
IpahEngine = new IncomingPacketAsyncHandlingEngine(this);
OqrEngine = new OutgoingQueueRefillEngine(this);
}
@@ -461,6 +468,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
StartInbound();
StartOutbound();
IpahEngine.Start();
OqrEngine.Start();
m_elapsedMSSinceLastStatReport = Environment.TickCount;
@@ -506,6 +514,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_log.Info("[LLUDPSERVER]: Shutting down the LLUDP server for " + Scene.Name);
base.StopOutbound();
base.StopInbound();
IpahEngine.Stop();
OqrEngine.Stop();
}