Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Added user-friendly controls over disk usage configuration settings.

luccioman68afe900d079
diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java
index df8a94bef..23dec663a 100644
--- a/htroot/PerformanceQueues_p.java
+++ b/htroot/PerformanceQueues_p.java
@@ -72,11 +72,29 @@ public class PerformanceQueues_p {
prop.put("setStartupCommit", "1");
}
if(post.containsKey("diskFree")) {
- sb.setConfig(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_STEADYSTATE, post.getInt("diskFree", 3000));
+ sb.setConfig(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_STEADYSTATE, post.getLong("diskFree", SwitchboardConstants.RESOURCE_DISK_FREE_MIN_STEADYSTATE_DEFAULT));
}
if(post.containsKey("diskFreeHardlimit")) {
- sb.setConfig(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_UNDERSHOT, post.getInt("diskFreeHardlimit", 1000));
+ sb.setConfig(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_UNDERSHOT, post.getLong("diskFreeHardlimit", SwitchboardConstants.RESOURCE_DISK_FREE_MIN_UNDERSHOT_DEFAULT));
+
+ /* This is a checkbox in Performance_p.html : when not checked the value is not in post parameters,
+ * so we take only in account when the relate diskFreeHardlimit is set */
+ sb.setConfig(SwitchboardConstants.RESOURCE_DISK_FREE_AUTOREGULATE,
+ post.getBoolean("diskFreeAutoregulate"));
}
+ if (post.containsKey("diskUsed")) {
+ sb.setConfig(SwitchboardConstants.RESOURCE_DISK_USED_MAX_STEADYSTATE,
+ post.getLong("diskUsed", SwitchboardConstants.RESOURCE_DISK_USED_MAX_STEADYSTATE_DEFAULT));
+ }
+ if (post.containsKey("diskUsedHardlimit")) {
+ sb.setConfig(SwitchboardConstants.RESOURCE_DISK_USED_MAX_OVERSHOT, post.getLong("diskUsedHardlimit",
+ SwitchboardConstants.RESOURCE_DISK_USED_MAX_OVERSHOT_DEFAULT));
+
+ /* This is a checkbox in Performance_p.html : when not checked the value is not in post parameters,
+ * so we take only in account when the related diskFreeHardlimit is set */
+ sb.setConfig(SwitchboardConstants.RESOURCE_DISK_USED_AUTOREGULATE,
+ post.getBoolean("diskUsedAutoregulate"));
+ }
if(post.containsKey("memoryAcceptDHT")) {
sb.setConfig(SwitchboardConstants.MEMORY_ACCEPTDHT, post.getInt("memoryAcceptDHT", 50));
}
@@ -308,6 +326,14 @@ public class PerformanceQueues_p {
final boolean observerTrigger = !MemoryControl.properState();
prop.put("diskFree", diskFree);
prop.put("diskFreeHardlimit", diskFreeHardlimit);
+ prop.put("diskFreeAutoregulate", sb.getConfigBool(SwitchboardConstants.RESOURCE_DISK_FREE_AUTOREGULATE,
+ SwitchboardConstants.RESOURCE_DISK_FREE_AUTOREGULATE_DEFAULT) ? 1 : 0);
+ prop.put("diskUsed", sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_USED_MAX_STEADYSTATE,
+ SwitchboardConstants.RESOURCE_DISK_USED_MAX_STEADYSTATE_DEFAULT));
+ prop.put("diskUsedHardlimit", sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_USED_MAX_OVERSHOT,
+ SwitchboardConstants.RESOURCE_DISK_USED_MAX_OVERSHOT_DEFAULT));
+ prop.put("diskUsedAutoregulate", sb.getConfigBool(SwitchboardConstants.RESOURCE_DISK_USED_AUTOREGULATE,
+ SwitchboardConstants.RESOURCE_DISK_USED_AUTOREGULATE_DEFAULT) ? 1 : 0);
prop.put("memoryAcceptDHT", memoryAcceptDHT);
if(observerTrigger) prop.put("observerTrigger", "1");
diff --git a/htroot/Performance_p.html b/htroot/Performance_p.html
index 498ae8421..605dbfe0b 100644
--- a/htroot/Performance_p.html
+++ b/htroot/Performance_p.html
@@ -1,5 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html lang="en">
<head>
<title>YaCy '#[clientname]#': Performance Settings</title>
#%env/templates/metas.template%#
@@ -26,7 +26,7 @@
<fieldset>
<legend>Memory Settings</legend>
<dl>
- <dt><label for="Xmx">Memory reserved for JVM</label></dt>
+ <dt><label for="Xmx">Memory reserved for <abbr title="Java Virtual Machine">JVM</abbr></label></dt>
<dd><input name="Xmx" id="Xmx" type="text" size="5" maxlength="5" value="#[Xmx]#" /> MByte&nbsp;
<input type="submit" class="btn btn-primary" name="setStartup" value="Set" />&nbsp;
#(setStartupCommit)#::<div class="commit">Accepted change. This will take effect after <strong>restart</strong> of YaCy. <br/><a href="Steering.html?restart=" onclick="return confirm('Confirm Restart')">restart now</a></div>::<div class="error"></div>#(/setStartupCommit)#
@@ -38,17 +38,87 @@
<form action="Performance_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset>
<legend>Resource Observer</legend>
- <dl>
- <dt>&nbsp;</dt>
- <dd>DHT-Trigger #(observerTrigger)#not triggered::<strong>triggered</strong>#(/observerTrigger)# <a href="?resetObserver=">[reset state]</a></dd>
- <dt><label for="diskFree">HDD</label></dt>
- <dd>disable crawls below <input name="diskFree" id="diskFree" type="text" size="4" value="#[diskFree]#" /> MiB free space,<br/>
- disable DHT-in below <input name="diskFreeHardlimit" id="diskFreeHardlimit" type="text" size="4" value="#[diskFreeHardlimit]#" /> MiB free space</dd>
- <dt><label for="memoryAcceptDHT">RAM</label></dt>
- <dd>disable DHT-in below <input name="memoryAcceptDHT" id="memoryAcceptDHT" type="text" size="4" value="#[memoryAcceptDHT]#" /> MiB free space</dd>
- <dt>&nbsp;</dt>
- <dd><input type="submit" class="btn btn-primary" name="setObserver" value="Save" /></dd>
- </dl>
+ <div class="col-sm-12">
+ <abbr title="Distributed Hash Table">DHT</abbr>-Trigger #(observerTrigger)#not triggered::<strong>triggered</strong>#(/observerTrigger)# <a href="?resetObserver=">[reset state]</a>
+ </div>
+ <div class="col-sm-6">
+ <fieldset>
+ <legend>Free space disk</legend>
+ <div class="form-group">
+ <label for="diskFree">Steady-state minimum</label>
+ <input name="diskFree" id="diskFree" type="text" size="4" value="#[diskFree]#" title="Amount of space (in Mebibytes) that should be kept free as steady state"/> <abbr title="Mebibyte">MiB</abbr>. Disable crawls when free space is below.
+ </div>
+ <div class="form-group">
+ <label for="diskFreeHardlimit">Absolute minimum</label>
+ <input name="diskFreeHardlimit" id="diskFreeHardlimit" type="text" size="4" value="#[diskFreeHardlimit]#" title="Amount of space (in Mebibytes) that should at least be kept free as hard limit"/> <abbr title="Mebibyte">MiB</abbr>. Disable <abbr title="Distributed Hash Table">DHT</abbr>-in when free space is below.
+ </div>
+ <div class="form-group">
+ <label for="diskFreeAutoregulate">Autoregulate</label>
+ <input name="diskFreeAutoregulate" id="diskFreeAutoregulate" type="checkbox" #(diskFreeAutoregulate)#::checked#(/diskFreeAutoregulate)# aria-describedby="autoregulateFreeInfo"/> when absolute minimum limit has been reached.
+ <div class="info" style="float:right">
+ <img src="env/grafics/i16.gif" width="16" height="16" alt="Free space disk autoregulation info"/>
+ <div style="right:0px;" id="autoregulateFreeInfo">
+ The autoregulation task performs the following sequence of operations, stopping once free space disk is over the steady-state value :
+ <ol>
+ <li>delete old releases</li>
+ <li>delete logs</li>
+ <li>delete robots.txt table</li>
+ <li>delete news</li>
+ <li>clear HTCACHE</li>
+ <li>clear citations</li>
+ <li>throw away large crawl queues</li>
+ <li>cut away too large RWIs</li>
+ </ol>
+ </div>
+ </div>
+ </div>
+ </fieldset>
+ </div>
+ <div class="col-sm-6">
+ <fieldset>
+ <legend>Used space disk</legend>
+ <div class="form-group">
+ <label for="diskUsed">Steady-state maximum</label>
+ <input name="diskUsed" id="diskUsed" type="text" size="7" value="#[diskUsed]#" title="Maximum amount of space (in Mebibytes) that should be used as steady state"/> <abbr title="Mebibyte">MiB</abbr>. Disable crawls when used space is over.
+ </div>
+ <div class="form-group">
+ <label for="diskUsedHardlimit">Absolute maximum</label>
+ <input name="diskUsedHardlimit" id="diskUsedHardlimit" type="text" size="7" value="#[diskUsedHardlimit]#" title="Maximum amount of space (in Mebibytes) that should be used as hard limit"/> <abbr title="Mebibyte">MiB</abbr>. Disable <abbr title="Distributed Hash Table">DHT</abbr>-in when used space is over.
+ </div>
+ <div class="form-group">
+ <label for="diskUsedAutoregulate">Autoregulate</label>
+ <input name="diskUsedAutoregulate" id="diskUsedAutoregulate" type="checkbox" #(diskUsedAutoregulate)#::checked#(/diskUsedAutoregulate)# aria-describedby="autoregulateUsedInfo"> when absolute maximum limit has been reached.
+ <div class="info" style="float:right">
+ <img src="env/grafics/i16.gif" width="16" height="16" alt="Used space disk autoregulation info"/>
+ <div style="right:0px;" id="autoregulateUsedInfo">
+ The autoregulation task performs the following sequence of operations, stopping once used space disk is below the steady-state value:
+ <ol>
+ <li>delete old releases</li>
+ <li>delete logs</li>
+ <li>delete robots.txt table</li>
+ <li>delete news</li>
+ <li>clear HTCACHE</li>
+ <li>clear citations</li>
+ <li>throw away large crawl queues</li>
+ <li>cut away too large RWIs</li>
+ </ol>
+ </div>
+ </div>
+ </div>
+ </fieldset>
+ </div>
+ <div class="col-sm-12">
+ <fieldset>
+ <legend><abbr title="Random Access Memory">RAM</abbr></legend>
+ <div class="form-group">
+ <label for="memoryAcceptDHT">disable <abbr title="Distributed Hash Table">DHT</abbr>-in below</label>
+ <input name="memoryAcceptDHT" id="memoryAcceptDHT" type="text" size="4" value="#[memoryAcceptDHT]#" /> <abbr title="Mebibyte">MiB</abbr> free space
+ </div>
+ </fieldset>
+ </div>
+ <div class="col-sm-6">
+ <input type="submit" class="btn btn-primary" name="setObserver" value="Save" />
+ </div>
</fieldset>
</form>
@@ -79,7 +149,7 @@
<td align="right"><input id="crawlPauseRemotesearch" name="crawlPauseRemotesearch" type="text" size="20" maxlength="100" value="#[crawlPauseRemotesearch]#" /></td>
</tr>
<tr class="TableCellLight">
- <td align="left" colspan="2"><input type="submit" class="btn btn-sm btn-primary"name="onlineCautionSubmit" value="Enter New Parameters" />
+ <td align="left" colspan="2"><input type="submit" class="btn btn-sm btn-primary" name="onlineCautionSubmit" value="Enter New Parameters" />
Changes take effect immediately</td>
</tr>
</table>
diff --git a/htroot/env/base.css b/htroot/env/base.css
index 924de111a..c0fef583d 100644
--- a/htroot/env/base.css
+++ b/htroot/env/base.css
@@ -1038,11 +1038,11 @@ div#tagcloud {
margin: 10px 0;
}
-.info span {
+.info span, .info div {
display: none;
}
-.info:hover span {
+.info:hover span, .info:hover div {
display: block;
position: absolute;
font-size:1em;
diff --git a/locales/cn.lng b/locales/cn.lng
index fadd57f80..f99640206 100644
--- a/locales/cn.lng
+++ b/locales/cn.lng
@@ -1996,20 +1996,19 @@ Attributes==属性
#File: Performance_p.html
#---------------------------
+<html lang="en">==<html lang="cn">
Performance Settings==性能设置
Memory Settings==内存设置
-Memory reserved for JVM==JVM内存设置
+Memory reserved for <abbr title="Java Virtual Machine">JVM</abbr>==<abbr title="Java Virtual Machine">JVM</abbr>内存设置
"Set"=="设置"
Resource Observer==资源查看
-DHT-Trigger==DHT-触发
+<abbr title="Distributed Hash Table">DHT</abbr>-Trigger==<abbr title="Distributed Hash Table">DHT</abbr>-触发
not triggered:==未触发:
>triggered==>已触发
reset state==重置
-HDD==硬盘
-disable crawls below==停止crawl当低于
-free space==空闲空间
-disable DHT-in below==停止接收DHT当低于
-RAM==内存
+> free space==> 空闲空间
+disable <abbr title="Distributed Hash Table">DHT</abbr>-in below==停止接收<abbr title="Distributed Hash Table">DHT</abbr>当低于
+<abbr title="Random Access Memory">RAM</abbr>==内存
Accepted change. This will take effect after <strong>restart</strong> of YaCy==已接受改变. 在YaCy<strong>重启</strong>后生效
restart now</a>==立即重启</a>
Confirm Restart==确定重启
diff --git a/locales/de.lng b/locales/de.lng
index b4eb77909..a1006c368 100644
--- a/locales/de.lng
+++ b/locales/de.lng
@@ -2431,20 +2431,19 @@ Attributes==Attribute
#File: Performance_p.html
#---------------------------
+<html lang="en">==<html lang="de">
Performance Settings==Leistungseinstellungen
Memory Settings==Speicher Einstellungen
-Memory reserved for JVM==Für JVM reservierter Speicher
+Memory reserved for <abbr title="Java Virtual Machine">JVM</abbr>==Für <abbr title="Java Virtual Machine">JVM</abbr> reservierter Speicher
"Set"=="Setzen"
Resource Observer==Ressourcen Beobachter
-DHT-Trigger==DHT-Umschalter
+<abbr title="Distributed Hash Table">DHT</abbr>-Trigger==<abbr title="Distributed Hash Table">DHT</abbr>-Umschalter
not triggered:==nicht ausgelöst:
>triggered==>ausgelöst
reset state==Status zurücksetzen
-HDD==Festplattenspeicher
-disable crawls below==Deaktivere Crawls unter
-free space==freiem Speicher
-disable DHT-in below==Deaktivere eingehende DHT Transfers unter
-RAM==Arbeitsspeicher
+> free space==> freiem Speicher
+disable <abbr title="Distributed Hash Table">DHT</abbr>-in below==Deaktivere eingehende <abbr title="Distributed Hash Table">DHT</abbr> Transfers unter
+<abbr title="Random Access Memory">RAM</abbr>==Arbeitsspeicher
Accepted change. This will take effect after <strong>restart</strong> of YaCy==Änderung akzeptiert. Diese werden erst nach einem <strong>Neustart</strong> von YaCy wirksam
restart now</a>==jetzt neustarten</a>
Confirm Restart==Bestätige Neustart
diff --git a/locales/master.lng.xlf b/locales/master.lng.xlf
index a5a96a3cd..7a3c4a531 100644
--- a/locales/master.lng.xlf
+++ b/locales/master.lng.xlf
@@ -6499,7 +6499,7 @@
<source>Memory Settings</source>
</trans-unit>
<trans-unit id="68be88d1" xml:space="preserve" approved="no" translate="yes">
- <source>Memory reserved for JVM</source>
+ <source>Memory reserved for &lt;abbr title="Java Virtual Machine"&gt;JVM&lt;/abbr&gt;</source>
</trans-unit>
<trans-unit id="2066342" xml:space="preserve" approved="no" translate="yes">
<source>"Set"</source>
@@ -6508,7 +6508,7 @@
<source>Resource Observer</source>
</trans-unit>
<trans-unit id="4e7c891b" xml:space="preserve" approved="no" translate="yes">
- <source>DHT-Trigger</source>
+ <source>&lt;abbr title="Distributed Hash Table"&gt;DHT&lt;/abbr&gt;-Trigger</source>
</trans-unit>
<trans-unit id="e2777230" xml:space="preserve" approved="no" translate="yes">
<source>not triggered:</source>
@@ -6520,19 +6520,19 @@
<source>reset state</source>
</trans-unit>
<trans-unit id="116c8" xml:space="preserve" approved="no" translate="yes">
- <source>HDD</source>
+ <source>Free space disk</source>
</trans-unit>
<trans-unit id="7911d675" xml:space="preserve" approved="no" translate="yes">
- <source>disable crawls below</source>
+ <source>Disable crawls when free space is below</source>
</trans-unit>
<trans-unit id="738c9a52" xml:space="preserve" approved="no" translate="yes">
- <source>free space</source>
+ <source>&gt; free space</source>
</trans-unit>
<trans-unit id="9963f88b" xml:space="preserve" approved="no" translate="yes">
- <source>disable DHT-in below</source>
+ <source>disable &lt;abbr title="Distributed Hash Table"&gt;DHT&lt;/abbr&gt;-in below</source>
</trans-unit>
<trans-unit id="13bfe" xml:space="preserve" approved="no" translate="yes">
- <source>RAM</source>
+ <source>&lt;abbr title="Random Access Memory"&gt;RAM&lt;/abbr&gt;</source>
</trans-unit>
<trans-unit id="8f4087b8" xml:space="preserve" approved="no" translate="yes">
<source>Accepted change. This will take effect after &lt;strong&gt;restart&lt;/strong&gt; of YaCy</source>
diff --git a/locales/ru.lng b/locales/ru.lng
index f18ae1771..6a8ea15c1 100644
--- a/locales/ru.lng
+++ b/locales/ru.lng
@@ -2535,20 +2535,18 @@ Attributes==Аттрибуты
#File: Performance_p.html
#---------------------------
+<html lang="en">==<html lang="ru">
Performance Settings==Настройки производительности
Memory Settings==Настройки оперативной памяти
-Memory reserved for JVM==Резервирование динамической памяти для Java
+Memory reserved for <abbr title="Java Virtual Machine">JVM</abbr>==Резервирование динамической памяти для Java
"Set"=="Сохранить"
Resource Observer==Обзор ресурсов
-DHT-Trigger==DHT-триггер
+<abbr title="Distributed Hash Table">DHT</abbr>-Trigger==<abbr title="Distributed Hash Table">DHT</abbr>-триггер
not triggered:==не срабатывает:
>triggered==>ausgelöst
reset state==сбросить состояние
-HDD==Жесткий диск
-disable crawls below==Остановить индексаторы при достижении
-free space==свободного места
-disable DHT-in below==Остановить DHT-приём при достижении
-RAM==RAM
+> free space==> свободного места
+disable <abbr title="Distributed Hash Table">DHT</abbr>-in below==Остановить <abbr title="Distributed Hash Table">DHT</abbr>-приём при достижении
Accepted change. This will take effect after <strong>restart</strong> of YaCy==Изменения будут применены после <strong>перезапуска</strong> YaCy
restart now</a>==Перезапустить сейчас</a>
Confirm Restart==Подтвердить перезапуск
diff --git a/locales/uk.lng b/locales/uk.lng
index eb1d0458a..cc51211e5 100644
--- a/locales/uk.lng
+++ b/locales/uk.lng
@@ -2167,20 +2167,19 @@ Attributes==Властивості
#File: Performance_p.html
#---------------------------
+<html lang="en">==<html lang="uk">
Performance Settings==Установки живлення
Memory Settings==Налаштування пам’яті
-Memory reserved for JVM==Пам’ять, утримувана для JVM
+Memory reserved for <abbr title="Java Virtual Machine">JVM</abbr>==Пам’ять, утримувана для <abbr title="Java Virtual Machine">JVM</abbr>
"Set"=="Виставити"
Resource Observer==Спостерігач за ресурсами
-DHT-Trigger==DHT-перемикач
+<abbr title="Distributed Hash Table">DHT</abbr>-Trigger==<abbr title="Distributed Hash Table">DHT</abbr>-перемикач
not triggered:==не перемкнено:
>triggered==>перемкнено
reset state==відновити стан
-HDD==Місце на жорсткому диску
-disable crawls below==Вимкнути сканування при менше
-free space==вільної пам’яті
-disable DHT-in below==Вимкнути отримання DHT при менше
-RAM==Основна пам’ять
+> free space==> вільної пам’яті
+disable <abbr title="Distributed Hash Table">DHT</abbr>-in below==Вимкнути отримання <abbr title="Distributed Hash Table">DHT</abbr> при менше
+<abbr title="Random Access Memory">RAM</abbr>==Основна пам’ять
Accepted change. This will take effect after <strong>restart</strong> of YaCy==Зміни прийняті. Вони вступлять в силу тільки після перезапуску <strong>YaCy</strong>
restart now</a>==перезапустити зараз</a>
Confirm Restart==Підтрвердіть перезапуск
diff --git a/source/net/yacy/search/ResourceObserver.java b/source/net/yacy/search/ResourceObserver.java
index b4ca16ab9..fb27d82b9 100644
--- a/source/net/yacy/search/ResourceObserver.java
+++ b/source/net/yacy/search/ResourceObserver.java
@@ -45,11 +45,14 @@ public class ResourceObserver {
public static final ConcurrentLog log = new ConcurrentLog("RESOURCE OBSERVER");
- // status type for which shows where in the control-circuit model a memory state can be categorized
+ /** status type for which shows where in the control-circuit model a memory state can be categorized */
public enum Space implements Comparable<Space> {
- EXHAUSTED, // smallest space state, outside of over/undershot
- NOMINAL, // wanted-space state between steady-state and under/overshot
- AMPLE; // largest space state, below steady-state
+ /** smallest space state, outside of over/undershot */
+ EXHAUSTED,
+ /** wanted-space state between steady-state and under/overshot */
+ NOMINAL,
+ /** largest space state, below steady-state */
+ AMPLE;
}
private final Switchboard sb;
@@ -103,8 +106,8 @@ public class ResourceObserver {
}
// shrink resources if space is EXHAUSTED
- if ((this.normalizedDiskFree == Space.EXHAUSTED && this.sb.getConfigBool(SwitchboardConstants.RESOURCE_DISK_FREE_AUTOREGULATE, false)) ||
- (this.normalizedDiskUsed == Space.EXHAUSTED && this.sb.getConfigBool(SwitchboardConstants.RESOURCE_DISK_USED_AUTOREGULATE, false))) {
+ if ((this.normalizedDiskFree == Space.EXHAUSTED && this.sb.getConfigBool(SwitchboardConstants.RESOURCE_DISK_FREE_AUTOREGULATE, SwitchboardConstants.RESOURCE_DISK_FREE_AUTOREGULATE_DEFAULT)) ||
+ (this.normalizedDiskUsed == Space.EXHAUSTED && this.sb.getConfigBool(SwitchboardConstants.RESOURCE_DISK_USED_AUTOREGULATE, SwitchboardConstants.RESOURCE_DISK_USED_AUTOREGULATE_DEFAULT))) {
shrinkmethods: while (true /*this is not a loop, just a construct that we can leave with a break*/) {
// delete old releases
if (yacyRelease.deleteOldDownloads(sb.releasePath, 1)) log.warn("DISK SPACE EXHAUSTED - deleting downloaded releases files");
@@ -316,31 +319,35 @@ public class ResourceObserver {
}
/**
- * @return amount of space (bytes) that should be used in steady state
+ * @return the maximum amount of space (bytes) that should be used as steady state
*/
public long getMaxUsedDiskSteadystate() {
- return this.sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_USED_MAX_STEADYSTATE, 524288) /* MB */ * 1024L * 1024L;
+ return this.sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_USED_MAX_STEADYSTATE,
+ SwitchboardConstants.RESOURCE_DISK_USED_MAX_STEADYSTATE_DEFAULT) /* MB */ * 1024L * 1024L;
}
/**
- * @return amount of space (bytes) that should at least be kept free as hard limit; the limit when autoregulation to steady state should start
+ * @return the maximum amount of space (bytes) that should be used as hard limit; the limit when autoregulation to steady state should start
*/
public long getMaxUsedDiskOvershot() {
- return this.sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_USED_MAX_OVERSHOT, 1048576) /* MB */ * 1024L * 1024L;
+ return this.sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_USED_MAX_OVERSHOT,
+ SwitchboardConstants.RESOURCE_DISK_USED_MAX_OVERSHOT_DEFAULT) /* MB */ * 1024L * 1024L;
}
/**
* @return amount of space (bytes) that should be kept free as steady state
*/
public long getMinFreeDiskSteadystate() {
- return this.sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_STEADYSTATE, 2048) /* MB */ * 1024L * 1024L;
+ return this.sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_STEADYSTATE,
+ SwitchboardConstants.RESOURCE_DISK_FREE_MIN_STEADYSTATE_DEFAULT) /* MB */ * 1024L * 1024L;
}
/**
* @return amount of space (bytes) that should at least be kept free as hard limit; the limit when autoregulation to steady state should start
*/
public long getMinFreeDiskUndershot() {
- return this.sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_UNDERSHOT, 1024) /* MB */ * 1024L * 1024L;
+ return this.sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_UNDERSHOT,
+ SwitchboardConstants.RESOURCE_DISK_FREE_MIN_UNDERSHOT_DEFAULT) /* MB */ * 1024L * 1024L;
}
/**
diff --git a/source/net/yacy/search/SwitchboardConstants.java b/source/net/yacy/search/SwitchboardConstants.java
index ddc10283c..3a20a4682 100644
--- a/source/net/yacy/search/SwitchboardConstants.java
+++ b/source/net/yacy/search/SwitchboardConstants.java
@@ -409,19 +409,48 @@ public final class SwitchboardConstants {
public static final String WORK_PATH_DEFAULT = "DATA/WORK";
- /**
+ /*
* ResourceObserver
* We apply the naming of control circuit states to resources observer limit values (steady-state value, over/undershot)
* under/overshot states in the system are supposed to be regulated to match the steady-state value
* ATTENTION: be aware that using the autoregulate-option causes that the search index data is DELETED as soon as threshold-values are reached!
*/
+
+ /** Setting key to enable auto-regulation on disk free threshold values */
public static final String RESOURCE_DISK_FREE_AUTOREGULATE = "resource.disk.free.autoregulate";
- public static final String RESOURCE_DISK_FREE_MIN_STEADYSTATE = "resource.disk.free.min.steadystate"; // the target steady-state of minimum disk space left
- public static final String RESOURCE_DISK_FREE_MIN_UNDERSHOT = "resource.disk.free.min.undershot"; // the undershot below the steady-state of minimum disk free as absolute size
+ /** Default disk free auto-regulation activation setting */
+ public static final boolean RESOURCE_DISK_FREE_AUTOREGULATE_DEFAULT = false;
+
+ /** Setting key for the target steady-state of minimum disk space left */
+ public static final String RESOURCE_DISK_FREE_MIN_STEADYSTATE = "resource.disk.free.min.steadystate";
+
+ /** Default value for target steady-state of minimum disk space left */
+ public static final long RESOURCE_DISK_FREE_MIN_STEADYSTATE_DEFAULT = 2048L;
+
+ /** Setting key for the undershot below the steady-state of minimum disk free as absolute size */
+ public static final String RESOURCE_DISK_FREE_MIN_UNDERSHOT = "resource.disk.free.min.undershot";
+
+ /** Default value for undershot below the steady-state of minimum disk free as absolute size */
+ public static final long RESOURCE_DISK_FREE_MIN_UNDERSHOT_DEFAULT = 1024L;
+
+ /** Setting key to enable auto-regulation on disk used threshold values */
public static final String RESOURCE_DISK_USED_AUTOREGULATE = "resource.disk.used.autoregulate";
+
+ /** Default disk used auto-regulation activation setting */
+ public static final boolean RESOURCE_DISK_USED_AUTOREGULATE_DEFAULT = false;
+
+ /** Setting key for the disk used maximum steady state value */
public static final String RESOURCE_DISK_USED_MAX_STEADYSTATE = "resource.disk.used.max.steadystate";
- public static final String RESOURCE_DISK_USED_MAX_OVERSHOT = "resource.disk.used.max.overshot";
+
+ /** Default disk used maximum steady state value (in mebibyte)*/
+ public static final long RESOURCE_DISK_USED_MAX_STEADYSTATE_DEFAULT = 524288L;
+
+ /** Setting key for the disk used hard upper limit value */
+ public static final String RESOURCE_DISK_USED_MAX_OVERSHOT = "resource.disk.used.max.overshot";
+
+ /** Default disk used hard upper limit value (in mebibyte) */
+ public static final long RESOURCE_DISK_USED_MAX_OVERSHOT_DEFAULT = 1048576L;
public static final String MEMORY_ACCEPTDHT = "memory.acceptDHTabove"; // minimum memory to accept dht-in (MiB)
public static final String INDEX_RECEIVE_AUTODISABLED = "memory.disabledDHT"; // set if DHT was disabled by ResourceObserver