From e4d16e67955cf40861caf31116efe6e727eabdfa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 4 Sep 2014 18:24:59 +0100 Subject: Make LLUDP output queue refill thread active by default, since load tests have shown that this has better scalability. For testing, previous behaviour can be restored with the console command "debug lludp oqre stop" at runtime. --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 2 ++ OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 87aa37d..e879e76 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -447,6 +447,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { StartInbound(); StartOutbound(); + OqrEngine.Start(); m_elapsedMSSinceLastStatReport = Environment.TickCount; } @@ -491,6 +492,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_log.Info("[LLUDPSERVER]: Shutting down the LLUDP server for " + Scene.Name); base.StopOutbound(); base.StopInbound(); + OqrEngine.Stop(); } protected override bool EnablePools() diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs b/OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs index 0659d8e..069c9c8 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OutgoingQueueRefillEngine.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP "debug lludp oqre", "debug lludp oqre ", "Start, stop or get status of OutgoingQueueRefillEngine.", - "Experimental.", + "If stopped then refill requests are processed directly via the threadpool.", HandleOqreCommand); } -- cgit v1.1 From 41f2f3132bdcbfb8020c7fd6e5f3b7e48c75b1cf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Sep 2014 23:20:59 +0100 Subject: For monitoring purposes, start non-timeout tasks (which do not currently use a threadpool) via Watchdog.RunInThread() rather than Util.RunThreadNoTimeout() The functionality is the same but this allow us to monitor such tasks via "show threads" and abort them for test purposes, etc. Also extends thread names to provide more info (e.g. SendInitialDataToClient says what client the task is for). --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 4 +++- .../Inventory/Archiver/InventoryArchiveWriteRequest.cs | 3 ++- .../Inventory/LocalInventoryServiceConnector.cs | 5 +++-- .../CoreModules/World/Archiver/ArchiveReadRequest.cs | 5 +++-- .../CoreModules/World/Archiver/ArchiveWriteRequest.cs | 3 ++- .../Region/CoreModules/World/Archiver/AssetsRequest.cs | 5 +++-- OpenSim/Region/Framework/Scenes/Scene.cs | 17 +++++++---------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++--- 8 files changed, 26 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index f06d70d..9d6870f 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -43,6 +43,7 @@ using Mono.Addins; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Console; +using OpenSim.Framework.Monitoring; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; @@ -963,7 +964,8 @@ namespace OpenSim.Region.CoreModules.Asset case "assets": con.Output("Ensuring assets are cached for all scenes."); - Util.RunThreadNoTimeout(delegate { + Watchdog.RunInThread(delegate + { int assetReferenceTotal = TouchAllSceneAssets(true); con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal); }, "TouchAllSceneAssets", null); diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index d15703e..a5b5aa2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -34,6 +34,7 @@ using System.Xml; using log4net; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Framework.Monitoring; using OpenSim.Framework.Serialization; using OpenSim.Framework.Serialization.External; using OpenSim.Region.CoreModules.World.Archiver; @@ -356,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_scene.UserAccountService, m_scene.RegionInfo.ScopeID, options, ReceivedAllAssets); - Util.RunThreadNoTimeout(o => ar.Execute(), "AssetsRequest", null); + Watchdog.RunInThread(o => ar.Execute(), string.Format("AssetsRequest ({0})", m_scene.Name), null); } else { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index f80fab3..470ef02 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -33,6 +33,7 @@ using System; using System.Collections.Generic; using System.Reflection; using OpenSim.Framework; +using OpenSim.Framework.Monitoring; using OpenSim.Data; using OpenSim.Server.Base; using OpenSim.Region.Framework.Interfaces; @@ -183,12 +184,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory // Protect ourselves against the caller subsequently modifying the items list List items = new List(invCol.Items); - Util.RunThreadNoTimeout(delegate + Watchdog.RunInThread(delegate { foreach (InventoryItemBase item in items) if (!string.IsNullOrEmpty(item.CreatorData)) UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); - }, "GetFolderContent", null); + }, string.Format("GetFolderContent (user {0}, folder {1})", userID, folderID), null); } return invCol; diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index c8056d4..3e0c9f3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -36,6 +36,7 @@ using System.Xml; using log4net; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Framework.Monitoring; using OpenSim.Framework.Serialization; using OpenSim.Framework.Serialization.External; using OpenSim.Region.CoreModules.World.Terrain; @@ -371,7 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Start the scripts. We delayed this because we want the OAR to finish loading ASAP, so // that users can enter the scene. If we allow the scripts to start in the loop above // then they significantly increase the time until the OAR finishes loading. - Util.RunThreadNoTimeout(delegate(object o) + Watchdog.RunInThread(o => { Thread.Sleep(15000); m_log.Info("[ARCHIVER]: Starting scripts in scene objects"); @@ -386,7 +387,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver sceneContext.SceneObjects.Clear(); } - }, "ReadArchiveStartScripts", null); + }, string.Format("ReadArchiveStartScripts (request {0})", m_requestId), null); m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 448147a..803f24e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs @@ -36,6 +36,7 @@ using System.Xml; using log4net; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Framework.Monitoring; using OpenSim.Framework.Serialization; using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.Framework.Interfaces; @@ -199,7 +200,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_rootScene.AssetService, m_rootScene.UserAccountService, m_rootScene.RegionInfo.ScopeID, options, ReceivedAllAssets); - Util.RunThreadNoTimeout(o => ar.Execute(), "AssetsRequest", null); + Watchdog.RunInThread(o => ar.Execute(), "Archive Assets Request", null); // CloseArchive() will be called from ReceivedAllAssets() } diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 4f428c3..ec39bc0 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs @@ -33,6 +33,7 @@ using System.Timers; using log4net; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Framework.Monitoring; using OpenSim.Framework.Serialization; using OpenSim.Framework.Serialization.External; using OpenSim.Services.Interfaces; @@ -226,7 +227,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver finally { if (timedOut) - Util.RunThreadNoTimeout(PerformAssetsRequestCallback, "AssetsRequestCallback", true); + Watchdog.RunInThread(PerformAssetsRequestCallback, "Archive Assets Request Callback", true); } } @@ -295,7 +296,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver // We want to stop using the asset cache thread asap // as we now need to do the work of producing the rest of the archive - Util.RunThreadNoTimeout(PerformAssetsRequestCallback, "AssetsRequestCallback", false); + Watchdog.RunInThread(PerformAssetsRequestCallback, "Archive Assets Request Callback", false); } else { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5f0dbd7..28dbccb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1623,7 +1623,12 @@ namespace OpenSim.Region.Framework.Scenes { tmpMS = Util.EnvironmentTickCount(); m_cleaningTemps = true; - Util.RunThreadNoTimeout(delegate { CleanTempObjects(); m_cleaningTemps = false; }, "CleanTempObjects", null); + + Watchdog.RunInThread( + delegate { CleanTempObjects(); m_cleaningTemps = false; }, + string.Format("CleanTempObjects ({0})", Name), + null); + tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS); } @@ -1803,7 +1808,7 @@ namespace OpenSim.Region.Framework.Scenes if (!m_backingup) { m_backingup = true; - Util.RunThreadNoTimeout(BackupWaitCallback, "BackupWaitCallback", null); + Watchdog.RunInThread(o => Backup(false), string.Format("BackupWaitCallback ({0})", Name), null); } } @@ -1814,14 +1819,6 @@ namespace OpenSim.Region.Framework.Scenes { m_eventManager.TriggerOnFrame(); } - - /// - /// Wrapper for Backup() that can be called with Util.RunThreadNoTimeout() - /// - private void BackupWaitCallback(object o) - { - Backup(false); - } /// /// Backup the scene. diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3c37de8..59b521d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -37,6 +37,7 @@ using log4net; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Client; +using OpenSim.Framework.Monitoring; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Animation; using OpenSim.Region.Framework.Scenes.Types; @@ -3362,7 +3363,7 @@ namespace OpenSim.Region.Framework.Scenes SentInitialDataToClient = true; // Send all scene object to the new client - Util.RunThreadNoTimeout(delegate + Watchdog.RunInThread(delegate { // m_log.DebugFormat( // "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", @@ -3380,8 +3381,7 @@ namespace OpenSim.Region.Framework.Scenes if (e != null && e is SceneObjectGroup) ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); } - - }, "SendInitialDataToClient", null); + }, string.Format("SendInitialDataToClient ({0} in {1})", Name, Scene.Name), null); } /// -- cgit v1.1