Skip to content

Commit

Permalink
removed high/med/low from kelondroRecords cache control.
Browse files Browse the repository at this point in the history
this was done because testing showed that cache-delete operations
slowed down record access most, even more that actual IO operations.
Cache-delete operations appeared when entries were shifted from low-priority
positions to high-priority positions. During a fill of x entries to a database,
x/2 delete situation happen which caused two or more delete operations.
removing the cache control means that these delete operations are not
necessary any more, but it is more difficult to decide which cache elements
shall be removed in case that the cache is full. There is not yet a stable
solution for this case, but the advantage of a faster cache is more important
that the flush problem.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2244 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Jun 25, 2006
1 parent 6866bc2 commit 66964dc
Show file tree
Hide file tree
Showing 23 changed files with 95 additions and 259 deletions.
2 changes: 1 addition & 1 deletion build.properties
Expand Up @@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4

# Release Configuration
releaseVersion=0.454
releaseVersion=0.455
releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
#releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}
Expand Down
67 changes: 27 additions & 40 deletions htroot/PerformanceMemory_p.html

Large diffs are not rendered by default.

25 changes: 9 additions & 16 deletions htroot/PerformanceMemory_p.java
Expand Up @@ -62,11 +62,12 @@ public class PerformanceMemory_p {
private static final long MB = 1024 * KB;
private static Map defaultSettings = null;

private static int[] slt,chk;
private static int chk;
private static int[] slt;
private static String[] ost;
private static long req, usd, bst, god;
private static long req, usd, bst;

private static long usedTotal, currTotal, dfltTotal, goodTotal, bestTotal;
private static long usedTotal, currTotal, dfltTotal, bestTotal;

public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
Expand Down Expand Up @@ -160,7 +161,6 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
usedTotal = 0;
currTotal = 0;
dfltTotal = 0;
goodTotal = 0;
bestTotal = 0;

req = sb.wordIndex.size();
Expand Down Expand Up @@ -238,7 +238,6 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("usedTotal", usedTotal / MB);
prop.put("currTotal", currTotal / MB);
prop.put("dfltTotal", dfltTotal / MB);
prop.put("goodTotal", goodTotal / MB);
prop.put("bestTotal", bestTotal / MB);

// parse initialization memory settings
Expand Down Expand Up @@ -294,17 +293,13 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
}

private static void putprop(serverObjects prop, serverSwitch env, String db, String set) {
usd = ((long) chk[0]) * ((long) slt[3]) + ((long) chk[1]) * ((long) slt[2]) + ((long) chk[2]) * ((long) slt[1]);
bst = (((((long) chk[2]) * ((long) req)) >> 10) + 1) << 10;
god = (((((long) bst) / ((long) (1+slt[1]+slt[2]+slt[3])) * ((long) slt[1])) >> 10) + 1) << 10;
if (set.equals("setGood")) env.setConfig("ramCache" + db, god);
usd = ((long) chk) * ((long) slt[1]);
bst = (((((long) chk) * ((long) req)) >> 10) + 1) << 10;
if (set.equals("setBest")) env.setConfig("ramCache" + db, bst);
prop.put("chunk" + db, chk[2] + "/" + chk[1] + "/" + chk[0]);
prop.put("chunk" + db, chk);
prop.put("slreq" + db, req);
prop.put("slemp" + db, slt[0] - slt[1] - slt[2] - slt[3]);
prop.put("slhig" + db, slt[1]);
prop.put("slmed" + db, slt[2]);
prop.put("sllow" + db, slt[3]);
prop.put("slemp" + db, slt[0] - slt[1]);
prop.put("slfil" + db, slt[1]);
prop.put("slhittmiss" + db, slt[4] + ":" + slt[5]);
prop.put("sluniqdoub" + db, slt[6] + ":" + slt[7]);
prop.put("slflush" + db, slt[8] + ":" + slt[9]);
Expand All @@ -317,14 +312,12 @@ private static void putprop(serverObjects prop, serverSwitch env, String db, Str
prop.put("nuniqdoub" + db, ost[14] + ":" + ost[15]);
prop.put("nflush" + db, ost[16] + ":" + ost[17]);
prop.put("used" + db, usd / KB);
prop.put("good" + db, god / KB);
prop.put("best" + db, bst / KB);
prop.put("dflt" + db, Long.parseLong((String) defaultSettings.get("ramCache" + db)) / KB);
prop.put("ramCache" + db, Long.parseLong(env.getConfig("ramCache" + db, "0")) / KB);
usedTotal += usd;
currTotal += Long.parseLong(env.getConfig("ramCache" + db, "0"));
dfltTotal += Long.parseLong((String) defaultSettings.get("ramCache" + db));
goodTotal += god;
bestTotal += bst;
}
}
2 changes: 1 addition & 1 deletion source/de/anomic/data/blogBoard.java
Expand Up @@ -97,7 +97,7 @@ public int size() {
return datbase.size();
}

public int[] dbCacheNodeChunkSize() {
public int dbCacheNodeChunkSize() {
return datbase.cacheNodeChunkSize();
}

Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/data/messageBoard.java
Expand Up @@ -86,7 +86,7 @@ public int size() {
return database.size();
}

public int[] dbCacheNodeChunkSize() {
public int dbCacheNodeChunkSize() {
return database.cacheNodeChunkSize();
}

Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/data/userDB.java
Expand Up @@ -92,7 +92,7 @@ public userDB(File userTableFile, int bufferkb) {
}
}

public int[] dbCacheNodeChunkSize() {
public int dbCacheNodeChunkSize() {
return userTable.cacheNodeChunkSize();
}

Expand Down
12 changes: 4 additions & 8 deletions source/de/anomic/data/wikiBoard.java
Expand Up @@ -100,14 +100,10 @@ public int size() {
return datbase.size();
}

public int[] dbCacheNodeChunkSize() {
int[] db = datbase.cacheNodeChunkSize();
int[] bk = bkpbase.cacheNodeChunkSize();
int[] i = new int[3];
i[kelondroRecords.CP_LOW] = (db[kelondroRecords.CP_LOW] + bk[kelondroRecords.CP_LOW]) / 2;
i[kelondroRecords.CP_MEDIUM] = (db[kelondroRecords.CP_MEDIUM] + bk[kelondroRecords.CP_MEDIUM]) / 2;
i[kelondroRecords.CP_HIGH] = (db[kelondroRecords.CP_HIGH] + bk[kelondroRecords.CP_HIGH]) / 2;
return i;
public int dbCacheNodeChunkSize() {
int db = datbase.cacheNodeChunkSize();
int bk = bkpbase.cacheNodeChunkSize();
return (db + bk) / 2;
}

public int[] dbCacheNodeStatus() {
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/index/indexURL.java
Expand Up @@ -430,7 +430,7 @@ public void close() throws IOException {
if (urlHashCache != null) urlHashCache.close();
}

public int[] cacheNodeChunkSize() {
public int cacheNodeChunkSize() {
return urlHashCache.cacheNodeChunkSize();
}

Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/kelondro/kelondroIntBytesMap.java
Expand Up @@ -24,7 +24,7 @@

package de.anomic.kelondro;

public class kelondroIntBytesMap extends kelondroRowSet {
public class kelondroIntBytesMap extends kelondroRowBufferedSet {

public kelondroIntBytesMap(int payloadSize, int initSize) {
super(new kelondroRow(new int[]{4, payloadSize}), initSize);
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/kelondro/kelondroMap.java
Expand Up @@ -133,7 +133,7 @@ public int keySize() {
return dyn.row().width(0);
}

public int[] cacheNodeChunkSize() {
public int cacheNodeChunkSize() {
return dyn.cacheNodeChunkSize();
}

Expand Down

0 comments on commit 66964dc

Please sign in to comment.