mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
more expires; change profile requests from fifo to lifo. this should increase response on what is of current interest
This commit is contained in:
@@ -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>();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
// The pair of Dictionaries are used to handle the switching of classified ads
|
||||
// by maintaining a cache of classified id to creator id mappings and an interest
|
||||
// count. The entries are removed when the interest count reaches 0.
|
||||
Dictionary<UUID, UUID> m_classifiedCache = new Dictionary<UUID, UUID>();
|
||||
Dictionary<UUID, int> m_classifiedInterest = new Dictionary<UUID, int>();
|
||||
ExpiringCache<UUID, UserProfileCacheEntry> m_profilesCache = new ExpiringCache<UUID, UserProfileCacheEntry>();
|
||||
readonly Dictionary<UUID, UUID> m_classifiedCache = new Dictionary<UUID, UUID>();
|
||||
readonly Dictionary<UUID, int> m_classifiedInterest = new Dictionary<UUID, int>();
|
||||
readonly ExpiringCacheOS<UUID, UserProfileCacheEntry> m_profilesCache = new ExpiringCacheOS<UUID, UserProfileCacheEntry>(60000);
|
||||
IAssetCache m_assetCache;
|
||||
IGroupsModule m_groupsModule = null;
|
||||
|
||||
@@ -86,7 +86,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
public int reqtype;
|
||||
}
|
||||
|
||||
private ConcurrentQueue<AsyncPropsRequest> m_asyncRequests = new ConcurrentQueue<AsyncPropsRequest>();
|
||||
//private ConcurrentQueue<AsyncPropsRequest> m_asyncRequests = new ConcurrentQueue<AsyncPropsRequest>();
|
||||
private ConcurrentStack<AsyncPropsRequest> m_asyncRequests = new ConcurrentStack<AsyncPropsRequest>();
|
||||
private object m_asyncRequestsLock = new object();
|
||||
private bool m_asyncRequestsRunning = false;
|
||||
|
||||
@@ -94,7 +95,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
{
|
||||
lock(m_asyncRequestsLock)
|
||||
{
|
||||
while(m_asyncRequests.TryDequeue(out AsyncPropsRequest req))
|
||||
//while(m_asyncRequests.TryDequeue(out AsyncPropsRequest req))
|
||||
while (m_asyncRequests.TryPop(out AsyncPropsRequest req))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user