We are running bitcoin full-node on AWS EC2 r5.xlarge instance and the problem is that bitcoind uses almost all available memory - 24GB. If we try to use smaller instance types - bitcoind consumes all the memory and the instance itself becomes unavailable.
Expected behavior
bitcoind memory usage is limited by dbcache
and maxmempool
parameters
Actual behavior bitcoind uses 24GB of memory despite configuration
To reproduce Install bitcoind v0.21.1 on Amazon Linux 2 r5.xlarge instance. Get it fully synced. Check memory usage
System information Bitcoin Core version v0.21.1 OS - Amazon Linux 2 Instance type - r5.xlarge - 4 vCPU, 32GB RAM Disk for blockchain data - 500GB general purpose SSD
bitcoind start command:
0/usr/local/bin/bitcoind -daemon -pid=/run/bitcoind/bitcoind.pid -conf=/etc/bitcoin/bitcoin.conf -datadir=/data/bitcoind -txindex=1 -sysperms=true
/etc/bitcoin/bitcoin.conf:
0# [core]
1daemon=1
2datadir=/data/bitcoind
3dbbatchsize=16000000
4sysperms=1
5
6# [rpc]
7server=1
8rpcbind=0.0.0.0
9rpcport=8332
10rpcallowip=0.0.0.0
11rpcuser=******
12rpcpassword=******
13
14[main]
15[test]
16[regtest]