Merge branch 'ubitworkmaster'

avinationmerge
Melanie Thielker 2014-10-13 23:27:13 +02:00
commit 298e714c04
7 changed files with 39 additions and 10 deletions

View File

@ -57,24 +57,35 @@ namespace OpenSim.Framework.Servers.HttpServer
private bool m_running = true; private bool m_running = true;
private int slowCount = 0; private int slowCount = 0;
private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2); private SmartThreadPool m_threadPool;
public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
{ {
m_server = pSrv; m_server = pSrv;
m_WorkerThreadCount = pWorkerThreadCount; m_WorkerThreadCount = pWorkerThreadCount;
m_workerThreads = new Thread[m_WorkerThreadCount]; m_workerThreads = new Thread[m_WorkerThreadCount];
STPStartInfo startInfo = new STPStartInfo();
startInfo.IdleTimeout = 30000;
startInfo.MaxWorkerThreads = 15;
startInfo.MinWorkerThreads = 1;
startInfo.ThreadPriority = ThreadPriority.Normal;
startInfo.StartSuspended = true;
startInfo.ThreadPoolName = "PoolService";
m_threadPool = new SmartThreadPool(startInfo);
} }
public void Start() public void Start()
{ {
m_threadPool.Start();
//startup worker threads //startup worker threads
for (uint i = 0; i < m_WorkerThreadCount; i++) for (uint i = 0; i < m_WorkerThreadCount; i++)
{ {
m_workerThreads[i] m_workerThreads[i]
= Watchdog.StartThread( = Watchdog.StartThread(
PoolWorkerJob, PoolWorkerJob,
string.Format("PollServiceWorkerThread{0}:{1}", i, m_server.Port), string.Format("PollServiceWorkerThread {0}:{1}", i, m_server.Port),
ThreadPriority.Normal, ThreadPriority.Normal,
false, false,
false, false,

View File

@ -1850,7 +1850,7 @@ namespace OpenSim.Framework
STPStartInfo startInfo = new STPStartInfo(); STPStartInfo startInfo = new STPStartInfo();
startInfo.ThreadPoolName = "Util"; startInfo.ThreadPoolName = "Util";
startInfo.IdleTimeout = 2000; startInfo.IdleTimeout = 20000;
startInfo.MaxWorkerThreads = maxThreads; startInfo.MaxWorkerThreads = maxThreads;
startInfo.MinWorkerThreads = minThreads; startInfo.MinWorkerThreads = minThreads;

View File

@ -113,8 +113,8 @@ namespace OpenSim
if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod)) if (!String.IsNullOrEmpty(asyncCallMethodStr) && Utils.EnumTryParse<FireAndForgetMethod>(asyncCallMethodStr, out asyncCallMethod))
Util.FireAndForgetMethod = asyncCallMethod; Util.FireAndForgetMethod = asyncCallMethod;
stpMinThreads = startupConfig.GetInt("MinPoolThreads", 15); stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 );
stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 15); stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 25);
m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) "); m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) ");
} }

View File

@ -1305,7 +1305,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
PacketsSentCount++; PacketsSentCount++;
// Put the UDP payload on the wire // Put the UDP payload on the wire
AsyncBeginSend(buffer); //AsyncBeginSend(buffer);
SyncSend(buffer);
// Keep track of when this packet was sent out (right now) // Keep track of when this packet was sent out (right now)
outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue; outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue;

View File

@ -375,12 +375,28 @@ namespace OpenMetaverse
// Synchronous mode waits until the packet callback completes // Synchronous mode waits until the packet callback completes
// before starting the receive to fetch another packet // before starting the receive to fetch another packet
if (!m_asyncPacketHandling) // if (!m_asyncPacketHandling)
AsyncBeginReceive(); AsyncBeginReceive();
} }
} }
} }
public void SyncSend(UDPPacketBuffer buf)
{
try
{
m_udpSocket.SendTo(
buf.Data,
0,
buf.DataLength,
SocketFlags.None,
buf.RemoteEndPoint
);
}
catch (SocketException) { }
catch (ObjectDisposedException) { }
}
public void AsyncBeginSend(UDPPacketBuffer buf) public void AsyncBeginSend(UDPPacketBuffer buf)
{ {
// if (IsRunningOutbound) // if (IsRunningOutbound)

View File

@ -320,7 +320,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); m_proxyurl = config.Configs["Startup"].GetString("HttpProxy");
m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");
int maxThreads = 50; int maxThreads = 15;
IConfig httpConfig = config.Configs["HttpRequestModule"]; IConfig httpConfig = config.Configs["HttpRequestModule"];
if (httpConfig != null) if (httpConfig != null)
@ -336,12 +336,12 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
STPStartInfo startInfo = new STPStartInfo(); STPStartInfo startInfo = new STPStartInfo();
startInfo.IdleTimeout = 20000; startInfo.IdleTimeout = 20000;
startInfo.MaxWorkerThreads = maxThreads; startInfo.MaxWorkerThreads = maxThreads;
startInfo.MinWorkerThreads = 5; startInfo.MinWorkerThreads = 1;
startInfo.ThreadPriority = ThreadPriority.BelowNormal; startInfo.ThreadPriority = ThreadPriority.BelowNormal;
startInfo.StartSuspended = true; startInfo.StartSuspended = true;
startInfo.ThreadPoolName = "ScriptsHttpReq";
ThreadPool = new SmartThreadPool(startInfo); ThreadPool = new SmartThreadPool(startInfo);
ThreadPool.Start(); ThreadPool.Start();
} }
} }

View File

@ -100,6 +100,7 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
m_running = true; m_running = true;
m_thread = new Thread(DoWork); m_thread = new Thread(DoWork);
m_thread.Name = "OdeMeshWorker";
m_thread.Start(); m_thread.Start();
} }