From dc88ffc5b4e4db15bddd0dbc959b848f8f606335 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 18 Jul 2013 17:17:20 -0700 Subject: [PATCH] Delay the enqueueing of non-longpoll requests for 100ms. No need to have these requests actively on the processing queue if it seems they're not ready. --- .../Servers/HttpServer/PollServiceRequestManager.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index e8110795a8..727dbe56ce 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -96,7 +96,17 @@ namespace OpenSim.Framework.Servers.HttpServer private void ReQueueEvent(PollServiceHttpRequest req) { if (m_running) - m_requests.Enqueue(req); + { + // delay the enqueueing for 100ms. There's no need to have the event + // actively on the queue + Timer t = new Timer(self => { + ((Timer)self).Dispose(); + m_requests.Enqueue(req); + }); + + t.Change(100, Timeout.Infinite); + + } } public void Enqueue(PollServiceHttpRequest req)