more expires; change profile requests from fifo to lifo. this should increase response on what is of current interest

This commit is contained in:
UbitUmarov
2020-08-17 23:16:58 +01:00
parent c7d07fa40d
commit d82319f940
2 changed files with 19 additions and 10 deletions

View File

@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.Asset
private bool m_FileCacheEnabled = true;
private ExpiringCache<string, AssetBase> m_MemoryCache;
private ExpiringCacheOS<string, AssetBase> m_MemoryCache;
private bool m_MemoryCacheEnabled = false;
private ExpiringKey<string> m_negativeCache;
@@ -143,7 +143,6 @@ namespace OpenSim.Region.CoreModules.Asset
if (name == Name)
{
m_MemoryCache = new ExpiringCache<string, AssetBase>();
m_negativeCache = new ExpiringKey<string>(2000);
m_Enabled = true;
@@ -185,6 +184,9 @@ namespace OpenSim.Region.CoreModules.Asset
m_CacheWarnAt = assetConfig.GetInt("CacheWarnAt", m_CacheWarnAt);
}
if(m_MemoryCacheEnabled)
m_MemoryCache = new ExpiringCacheOS<string, AssetBase>((int)m_MemoryExpiration * 500);
m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory {0}", m_CacheDirectory);
if (m_CacheDirectoryTiers < 1)
@@ -352,7 +354,6 @@ namespace OpenSim.Region.CoreModules.Asset
private void UpdateMemoryCache(string key, AssetBase asset)
{
// NOTE DO NOT USE SLIDEEXPIRE option on current libomv
m_MemoryCache.AddOrUpdate(key, asset, m_MemoryExpiration);
}
@@ -676,11 +677,17 @@ namespace OpenSim.Region.CoreModules.Asset
}
if (m_MemoryCacheEnabled)
m_MemoryCache = new ExpiringCache<string, AssetBase>();
{
m_MemoryCache.Dispose();
m_MemoryCache = new ExpiringCacheOS<string, AssetBase>((int)m_MemoryExpiration * 500);
}
if (m_negativeCacheEnabled)
{
m_negativeCache.Dispose();
m_negativeCache = new ExpiringKey<string>(2000);
}
lock(weakAssetReferencesLock)
lock (weakAssetReferencesLock)
weakAssetReferences = new Dictionary<string, WeakReference>();
}