Browse Source
Dynamically set dbcache based on RAM size (#73)
mount-script-check
Aaron Dewes
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
1 deletions
-
bitcoin/bitcoin.conf
-
scripts/configure
|
|
@ -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 |
|
|
|
|
|
@ -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 |
|
|
|
|
|
|
|