Browse Source

Dynamically set dbcache based on RAM size (#73)

mount-script-check
Aaron Dewes 5 years ago
committed by GitHub
parent
commit
0ec4d5c3e1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      bitcoin/bitcoin.conf
  2. 4
      scripts/configure

2
bitcoin/bitcoin.conf

@ -14,7 +14,7 @@ rest=1
blocksonly=1 blocksonly=1
maxconnections=8 maxconnections=8
dbcache=1000 dbcache=1000
maxmempool=512 maxmempool=300
maxuploadtarget=5000 maxuploadtarget=5000
# uncomment test if testnet=1 is activated # uncomment test if testnet=1 is activated

4
scripts/configure

@ -97,6 +97,10 @@ if [ -z $TESTNET ] && [ -z $REGTEST ]; then
sed -i 's/RPCPORT/8332/g; ' docker-compose.yml sed -i 's/RPCPORT/8332/g; ' docker-compose.yml
fi 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" echo "Pulling Docker images"
docker-compose pull docker-compose pull

Loading…
Cancel
Save