Browse Source

Fix dbcache to 200MB (#769)

debug-formatting
Luke Childs 4 years ago
committed by GitHub
parent
commit
d7417507e4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docker-compose.yml
  2. 22
      scripts/configure
  3. 2
      templates/bitcoin-sample.conf

4
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:

22
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>/${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=<size>/dbcache=$DBCACHE_SIZE/g" "$BITCOIN_CONF_FILE"
# TODO: Adjust prune size based on available disk space
##########################################################
############## Override main config files ################
##########################################################

2
templates/bitcoin-sample.conf

@ -13,7 +13,7 @@ rpcallowip=127.0.0.1
rpcauth=<rpcauth>
# Memory
dbcache=<size>
dbcache=200
maxmempool=300
# zmq

Loading…
Cancel
Save