From d98af79f7727fd5d3cd94537b5b4d514f54f5250 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 4 Oct 2012 08:41:06 -0700 Subject: Make the asset retrieval concurrency a config switch. The current value of 30 is still hanging badly on some mono versions. The switch defaults to 30 to preserve current behavior. --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 086b5ad..2b2f11f 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -47,7 +47,8 @@ namespace OpenSim.Services.Connectors private string m_ServerURI = String.Empty; private IImprovedAssetCache m_Cache = null; - + private int m_maxAssetRequestConcurrency = 30; + private delegate void AssetRetrievedEx(AssetBase asset); // Keeps track of concurrent requests for the same asset, so that it's only loaded once. @@ -71,6 +72,10 @@ namespace OpenSim.Services.Connectors public virtual void Initialise(IConfigSource source) { + IConfig netconfig = source.Configs["Network"]; + if (netconfig != null) + m_maxAssetRequestConcurrency = netconfig.GetInt("MaxRequestConcurrency",m_maxAssetRequestConcurrency); + IConfig assetConfig = source.Configs["AssetService"]; if (assetConfig == null) { @@ -108,7 +113,7 @@ namespace OpenSim.Services.Connectors if (asset == null) { asset = SynchronousRestObjectRequester. - MakeRequest("GET", uri, 0, 30); + MakeRequest("GET", uri, 0, m_maxAssetRequestConcurrency); if (m_Cache != null) m_Cache.Cache(asset); @@ -221,7 +226,7 @@ namespace OpenSim.Services.Connectors m_AssetHandlers.Remove(id); } handlers.Invoke(a); - }, 30); + }, m_maxAssetRequestConcurrency); success = true; } -- cgit v1.1 From 5b90f5bb17b1bb73f670e6c2f90cca8395a2e9bc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 4 Oct 2012 15:32:49 -0700 Subject: One more abstraction for GridUser so that it can be overridden in a sub-class. --- .../Services/Connectors/GridUser/GridUserServicesConnector.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs index 20d7eaf..94bda82 100644 --- a/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs +++ b/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs @@ -207,7 +207,7 @@ namespace OpenSim.Services.Connectors if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null)) { if (replyData["result"] is Dictionary) - guinfo = new GridUserInfo((Dictionary)replyData["result"]); + guinfo = Create((Dictionary)replyData["result"]); } return guinfo; @@ -273,7 +273,7 @@ namespace OpenSim.Services.Connectors { if (griduser is Dictionary) { - GridUserInfo pinfo = new GridUserInfo((Dictionary)griduser); + GridUserInfo pinfo = Create((Dictionary)griduser); rinfos.Add(pinfo); } else @@ -286,5 +286,10 @@ namespace OpenSim.Services.Connectors return rinfos.ToArray(); } + + protected virtual GridUserInfo Create(Dictionary griduser) + { + return new GridUserInfo(griduser); + } } } -- cgit v1.1