mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
95693: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud) 94442: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1) 94393: Merged DEV (4.2.5) to V4.2-BUG-FIX (4.2.5) 94233: MNT-12802: CachingContentStore Quota & Performance Made the quota thresholds configurable. Introduced a property to configure a gap between normal cleanups. Changed cachingContentStoreCache configuration. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@95698 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -591,8 +591,8 @@ cache.samlTrustEngineSharedCache.readBackupData=${caches.readBackupData}
|
||||
|
||||
# Caching content store, see caching-content-store-context.xml.sample*
|
||||
cache.cachingContentStoreCache.maxItems=5000
|
||||
cache.cachingContentStoreCache.timeToLiveSeconds=0
|
||||
cache.cachingContentStoreCache.maxIdleSeconds=86400
|
||||
cache.cachingContentStoreCache.timeToLiveSeconds=86400
|
||||
cache.cachingContentStoreCache.maxIdleSeconds=14400
|
||||
cache.cachingContentStoreCache.cluster.type=local
|
||||
cache.cachingContentStoreCache.backup-count=${caches.backupCount}
|
||||
cache.cachingContentStoreCache.eviction-policy=LRU
|
||||
|
@@ -54,6 +54,11 @@
|
||||
<!-- maxFileSizeMB: files larger than this size will not be kept in the cache -->
|
||||
<property name="maxFileSizeMB" value="${system.content.caching.maxFileSizeMB}"/>
|
||||
|
||||
<property name="panicThresholdPct" value="${system.content.caching.panicThresholdPct}"/>
|
||||
<property name="cleanThresholdPct" value="${system.content.caching.cleanThresholdPct}"/>
|
||||
<property name="targetUsagePct" value="${system.content.caching.targetUsagePct}"/>
|
||||
<property name="normalCleanThresholdSec" value="${system.content.caching.normalCleanThresholdSec}"/>
|
||||
|
||||
<property name="cache" ref="contentCache"/>
|
||||
<property name="cleaner" ref="cachedContentCleaner"/>
|
||||
</bean>
|
||||
|
@@ -935,6 +935,16 @@ system.content.caching.minFileAgeMillis=60000
|
||||
system.content.caching.maxUsageMB=4096
|
||||
# maxFileSizeMB - 0 means no max file size.
|
||||
system.content.caching.maxFileSizeMB=0
|
||||
# When the CachingContentStore is about to write a cache file but the disk usage is in excess of panicThresholdPct
|
||||
# (default 90%) then the cache file is not written and the cleaner is started (if not already running) in a new thread.
|
||||
system.content.caching.panicThresholdPct=90
|
||||
# When a cache file has been written that results in cleanThresholdPct (default 80%) of maxUsageBytes
|
||||
# being exceeded then the cached content cleaner is invoked (if not already running) in a new thread.
|
||||
system.content.caching.cleanThresholdPct=80
|
||||
# An aggressive cleaner is run till the targetUsagePct (default 70%) of maxUsageBytes is achieved
|
||||
system.content.caching.targetUsagePct=70
|
||||
# Threshold in seconds indicating a minimal gap between normal cleanup starts
|
||||
system.content.caching.normalCleanThresholdSec=0
|
||||
|
||||
mybatis.useLocalCaches=false
|
||||
|
||||
|
@@ -62,7 +62,10 @@ public class StandardQuotaStrategy implements QuotaManagerStrategy, UsageTracker
|
||||
private int cleanThresholdPct = 80;
|
||||
private int targetUsagePct = 70;
|
||||
private long maxUsageBytes = 0;
|
||||
/* Threshold in seconds indicating a minimal gap between normal cleanup starts */
|
||||
private long normalCleanThresholdSec = 0;
|
||||
private AtomicLong currentUsageBytes = new AtomicLong(0);
|
||||
private AtomicLong lastCleanupStart = new AtomicLong(0);
|
||||
private CachedContentCleaner cleaner;
|
||||
private ContentCacheImpl cache; // impl specific functionality required
|
||||
private int maxFileSizeMB = 0;
|
||||
@@ -89,6 +92,8 @@ public class StandardQuotaStrategy implements QuotaManagerStrategy, UsageTracker
|
||||
}
|
||||
|
||||
loadDiskUsage();
|
||||
// Set the time to start the normal clean
|
||||
lastCleanupStart.set(System.currentTimeMillis() - normalCleanThresholdSec);
|
||||
// Run the cleaner thread so that it can update the disk usage more accurately.
|
||||
signalCleanerStart("quota (init)");
|
||||
}
|
||||
@@ -226,9 +231,21 @@ public class StandardQuotaStrategy implements QuotaManagerStrategy, UsageTracker
|
||||
}
|
||||
else
|
||||
{
|
||||
long timePassedFromLastClean = System.currentTimeMillis() - lastCleanupStart.get();
|
||||
if (timePassedFromLastClean < normalCleanThresholdSec * 1000)
|
||||
{
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("Skipping a normal clean as it is too soon. The last cleanup was run " + timePassedFromLastClean/1000f + " seconds ago.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lastCleanupStart.set(System.currentTimeMillis());
|
||||
cleaner.execute(reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run a non-aggressive clean up job in a new thread.
|
||||
@@ -294,6 +311,15 @@ public class StandardQuotaStrategy implements QuotaManagerStrategy, UsageTracker
|
||||
this.cleanThresholdPct = cleanThresholdPct;
|
||||
}
|
||||
|
||||
public void setTargetUsagePct(int targetUsagePct)
|
||||
{
|
||||
this.targetUsagePct = targetUsagePct;
|
||||
}
|
||||
|
||||
public void setNormalCleanThresholdSec(long normalCleanThresholdSec)
|
||||
{
|
||||
this.normalCleanThresholdSec = normalCleanThresholdSec;
|
||||
}
|
||||
|
||||
@Required
|
||||
public void setCache(ContentCacheImpl cache)
|
||||
|
Reference in New Issue
Block a user