Skip to content

Commit

Permalink
Merge pull request #617 from pr0vieh/master
Browse files Browse the repository at this point in the history
Add setting for DHT receive loadprereq insted of hardcoded load < 2.0
  • Loading branch information
Orbiter authored Dec 3, 2023
2 parents 4c603e2 + dfb2b79 commit d5d4e8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions defaults/yacy.init
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ collection=user
20_dhtdistribution_busysleep=15000
20_dhtdistribution_memprereq=12582912
20_dhtdistribution_loadprereq=2.0
20_dhtreceive_loadprereq=2.0
30_peerping_idlesleep=30000
30_peerping_busysleep=30000
30_peerping_memprereq=2097152
Expand Down
3 changes: 2 additions & 1 deletion source/net/yacy/htroot/yacy/transferRWI.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public static serverObjects respond(final RequestHeader header, final serverObje
return prop;
}
// load tests
if (Memory.getSystemLoadAverage() > 2.0 || MemoryControl.shortStatus()) {
final float maxReceiveLoad = sb.getConfigFloat(SwitchboardConstants.INDEX_RECEIVE_LOADPREREQ, 2.0f);
if (Memory.getSystemLoadAverage() > maxReceiveLoad || MemoryControl.shortStatus()) {
// check also Protocol.metadataRetrievalRunning.get() > 0 ?
result = "too high load"; // don't tell too much details
prop.put("result", result);
Expand Down
1 change: 1 addition & 0 deletions source/net/yacy/search/SwitchboardConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public final class SwitchboardConstants {
public static final String INDEX_DIST_LOADPREREQ = "20_dhtdistribution_loadprereq";
public static final String INDEX_DIST_IDLESLEEP = "20_dhtdistribution_idlesleep";
public static final String INDEX_DIST_BUSYSLEEP = "20_dhtdistribution_busysleep";
public static final String INDEX_RECEIVE_LOADPREREQ = "20_dhtreceive_loadprereq";
// 30_peerping
/**
* <p><code>public static final String <strong>PEER_PING</strong> = "30_peerping"</code></p>
Expand Down

0 comments on commit d5d4e8f

Please sign in to comment.