From 2fd55af0b5e3583e8cfc048441b5a09afd308fab Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 18 Jul 2018 17:18:51 +0200 Subject: [dnbd3-proxy] Scale maxReplicationSize according to cache partition --- .../data/opt/openslx/scripts/systemd-setup_dnbd3_proxy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/modules/dnbd3-proxy-mode') 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 -- cgit v1.2.3-55-g7522