diff --git a/defaults/yacy.init b/defaults/yacy.init index 1c80ab643..cb938392b 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -885,3 +885,5 @@ autoReCrawl_memprereq = -1 compare_yacy.left = YaCy compare_yacy.right = YaCy +# minimum free disk space for crawling (MiB) +disk.free = 3000 diff --git a/source/de/anomic/crawler/ResourceObserver.java b/source/de/anomic/crawler/ResourceObserver.java index f656313b5..0dc923a8e 100644 --- a/source/de/anomic/crawler/ResourceObserver.java +++ b/source/de/anomic/crawler/ResourceObserver.java @@ -32,9 +32,6 @@ import de.anomic.server.logging.serverLog; import de.anomic.tools.diskUsage; public final class ResourceObserver { - // The minimal free space on every used volume, for now set to 1000 MB. - // TODO make it configurable - private final static long MIN_FREE_DISK_SPACE = 1000L /* MiB */ * 1024L * 1024L; // Unknown for now //private final static long MIN_FREE_MEMORY = 0; // We are called with the cleanup job every five minutes; @@ -126,10 +123,10 @@ public final class ResourceObserver { } /** - * @return amount of space that should be kept free + * @return amount of space (MiB) that should be kept free */ public long getMinFreeDiskSpace () { - return MIN_FREE_DISK_SPACE; + return sb.getConfigLong("disk.free", 3000) /* MiB */ * 1024L * 1024L; } /** @@ -146,8 +143,8 @@ public final class ResourceObserver { for (final Map.Entry entry: usage.entrySet()) { val = entry.getValue(); this.log.logInfo("df of Volume " + entry.getKey() + ": " + (val[1] / 1024 / 1024) + " MB"); - if (val[1] < MIN_FREE_DISK_SPACE) { - this.log.logWarning("Volume " + entry.getKey() + ": free space (" + (val[1] / 1024 / 1024) + " MB) is too low (< " + (MIN_FREE_DISK_SPACE / 1024 / 1024) + " MB)"); + if (val[1] < getMinFreeDiskSpace()) { + this.log.logWarning("Volume " + entry.getKey() + ": free space (" + (val[1] / 1024 / 1024) + " MB) is too low (< " + (getMinFreeDiskSpace() / 1024 / 1024) + " MB)"); below = true; } }