diff options
Diffstat (limited to 'core/modules/dnbd3-proxy-mode')
-rwxr-xr-x | core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy index ff889fde..c9a4997c 100755 --- a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy +++ b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy @@ -87,7 +87,7 @@ if [ -n "${SLX_DNBD3_SPARSE}" ]; then DNBD3_SPARSE="true" fi # Determine if we need sparse mode, or override BGR -cache_size=$(disksize "$DNBD3_DATA_DIR") +cache_size=$(disksize "$DNBD3_DATA_DIR") # MB if ! [ "$cache_size" -gt 120000 ]; then # less than 120GiB or NaN, force [ "$DNBD3_BGR" = "true" ] && slxlog -s -e "dnbd3-setup-small" "Cache partition < 120GiB, forcing background replication OFF and sparse mode ON" @@ -100,6 +100,9 @@ elif [ "$cache_size" -gt 2000000 ]; then DNBD3_SPARSE="false" fi +MAX_REPLICATION_SIZE=$(( cache_size / 6 )) +[ "$MAX_REPLICATION_SIZE" -lt 100000 ] && MAX_REPLICATION_SIZE=100000 + DNBD3_PORT=5003 rm -f "${DNBD3_CONF_DIR}/server.conf" # Refer to http://git.openslx.org/dnbd3.git/tree/conf for configuration options @@ -117,6 +120,9 @@ removeMissingImages=false uplinkTimeout=5000 clientTimeout=15000 +[limits] +maxReplicationSize=${MAX_REPLICATION_SIZE}M + [logging] consoleMask=ERROR WARNING MINOR INFO EOF |