From d7417507e404f8b245e21d523d3976fcc517bcb6 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Sun, 2 May 2021 23:21:44 +0700 Subject: [PATCH] Fix dbcache to 200MB (#769) --- docker-compose.yml | 4 +--- scripts/configure | 22 ---------------------- templates/bitcoin-sample.conf | 2 +- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9632f11..63c9b89 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -144,12 +144,11 @@ services: ipv4_address: $MIDDLEWARE_IP neutrino-switcher: container_name: neutrino-switcher - image: getumbrel/neutrino-switcher:v1.2.0@sha256:4d9636aabd9d06ed3693173870d6ab57d4e08716c618a0457512d542c4cf9b01 + image: getumbrel/neutrino-switcher:v1.3.0@sha256:399ccea7f39129ff16c9c408f9e68a01dd4671f428273f3c3f401a8a0d2f7ddc depends_on: [ bitcoin, lnd ] restart: on-failure volumes: - ${PWD}/lnd:/lnd - - ${PWD}/bitcoin:/bitcoin - ${PWD}/statuses:/statuses - /var/run/docker.sock:/var/run/docker.sock environment: @@ -157,7 +156,6 @@ services: RPCUSER: $BITCOIN_RPC_USER RPCPASS: $BITCOIN_RPC_PASS LND_CONTAINER_NAME: lnd - BITCOIN_CONTAINER_NAME: bitcoin SLEEPTIME: 3600 networks: default: diff --git a/scripts/configure b/scripts/configure index 4b60869..dece228 100755 --- a/scripts/configure +++ b/scripts/configure @@ -323,28 +323,6 @@ for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" " sed -i "s//${APP_BLUEWALLET_REDIS_IP}/g" "${template}" done - -########################################################## -############### Performance optimizations ################ -########################################################## - -echo -echo "Making performance optimizations" -echo - -echo "Setting dbcache size" -echo -if [[ -f "${STATUS_DIR}/node-status-bitcoind-ready" ]]; then - # Limit dbcache to 200 after IBD - DBCACHE_SIZE="200" -else - # Allocate (50% of RAM) - 300MB to dbcache for IDB - DBCACHE_SIZE=$(awk '/MemTotal/{printf "%d\n", ($2/2^10 * 0.5) - 300}' /proc/meminfo) -fi -sed -i -e "s/dbcache=/dbcache=$DBCACHE_SIZE/g" "$BITCOIN_CONF_FILE" - -# TODO: Adjust prune size based on available disk space - ########################################################## ############## Override main config files ################ ########################################################## diff --git a/templates/bitcoin-sample.conf b/templates/bitcoin-sample.conf index a273ae2..7e56e4e 100644 --- a/templates/bitcoin-sample.conf +++ b/templates/bitcoin-sample.conf @@ -13,7 +13,7 @@ rpcallowip=127.0.0.1 rpcauth= # Memory -dbcache= +dbcache=200 maxmempool=300 # zmq