diff --git a/bitcoin/bitcoin.conf b/bitcoin/bitcoin.conf index 2f5ab03..5ccc2bf 100644 --- a/bitcoin/bitcoin.conf +++ b/bitcoin/bitcoin.conf @@ -14,7 +14,7 @@ rest=1 blocksonly=1 maxconnections=8 dbcache=1000 -maxmempool=512 +maxmempool=300 maxuploadtarget=5000 # uncomment test if testnet=1 is activated diff --git a/scripts/configure b/scripts/configure index 57079a5..402d2f0 100755 --- a/scripts/configure +++ b/scripts/configure @@ -97,6 +97,10 @@ if [ -z $TESTNET ] && [ -z $REGTEST ]; then sed -i 's/RPCPORT/8332/g; ' docker-compose.yml fi +echo "Setting dbcache size" +DBCACHE_SIZE=$(awk '/MemTotal/{printf "%d\n", ($2/2^10 * 0.5) - 300}' /proc/meminfo) +sed -i -e "s/dbcache=1000/dbcache=$DBCACHE_SIZE/g" bitcoin/bitcoin.conf + echo "Pulling Docker images" docker-compose pull