do a more frequent optimization, reduces IO after optimization

pull/1/head
Michael Peter Christen 11 years ago
parent 260d0c96c7
commit 93d1bac140

@ -3,7 +3,7 @@ javacSource=1.6
javacTarget=1.6
# Release Configuration
releaseVersion=1.51
releaseVersion=1.52
stdReleaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
sourceReleaseFile=yacy_src_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseFileParentDir=yacy

@ -2291,7 +2291,7 @@ public final class Switchboard extends serverSwitch {
long idleSearch = System.currentTimeMillis() - this.localSearchLastAccess;
long idleAdmin = System.currentTimeMillis() - this.adminAuthenticationLastAccess;
long deltaOptimize = System.currentTimeMillis() - this.optimizeLastRun;
boolean optimizeRequired = deltaOptimize > 60000 * 60 * 6; // 6 hours
boolean optimizeRequired = deltaOptimize > 60000 * 60 * 3; // 3 hours
log.info("Solr auto-optimization: idleSearch=" + idleSearch + ", idleAdmin=" + idleAdmin + ", deltaOptimize=" + deltaOptimize + ", proccount=" + proccount);
if (idleAdmin > 600000) {
// only run optimization if the admin is idle (10 minutes)
@ -2300,7 +2300,7 @@ public final class Switchboard extends serverSwitch {
index.fulltext().optimize(8);
}
if (optimizeRequired) {
int opts = idleSearch > 600000 ? 1 : 5;
int opts = idleSearch > 600000 ? 1 : 5; // > 10 minutes idle time will cause a full optimization, otherwise a 5-segment optimization
log.info("Solr auto-optimization: running solr.optimize(" + opts + ")");
index.fulltext().optimize(opts);
this.optimizeLastRun = System.currentTimeMillis();

Loading…
Cancel
Save