Browse Source

Reduce dbcache post IBD (#345)

btc-rpc-explorer-v2.1.0
Luke Childs 4 years ago
committed by GitHub
parent
commit
1354cdf8d6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docker-compose.yml
  2. 8
      scripts/configure

4
docker-compose.yml

@ -155,12 +155,13 @@ services:
ipv4_address: $MIDDLEWARE_IP
neutrino-switcher:
container_name: neutrino-switcher
image: getumbrel/neutrino-switcher:v1.0.3
image: getumbrel/neutrino-switcher:v1.1.1
logging: *default-logging
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:
@ -168,6 +169,7 @@ services:
RPCUSER: $BITCOIN_RPC_USER
RPCPASS: $BITCOIN_RPC_PASS
LND_CONTAINER_NAME: lnd
BITCOIN_CONTAINER_NAME: bitcoin
SLEEPTIME: 3600
networks:
default:

8
scripts/configure

@ -258,7 +258,13 @@ echo
echo "Setting dbcache size"
echo
DBCACHE_SIZE=$(awk '/MemTotal/{printf "%d\n", ($2/2^10 * 0.5) - 300}' /proc/meminfo)
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=<size>/dbcache=$DBCACHE_SIZE/g" "$BITCOIN_CONF_FILE"
# TODO: Adjust prune size based on available disk space

Loading…
Cancel
Save