I'm syncing my raspberry pi 4 model B, 4GB and after 4 days I'm less than 50% synced. It seems as though there is something wrong with bitcoind as there are some weird symptoms going on. The pi is running raspiblitz 1.7RC2 (64bit). I have 400mbps internet and it's connected to a new 1TB sandisk ssd.
First I looked at the debug.log file (sudo tail -f /mnt/hdd/bitcoin/debug.log
) When bitoind is first started up I see blocks being added at a rate of several per second. After letting it run for awhile it slows down to one block every few seconds. I also get ping timouts and my peer connections are constantly cutting off and don't exceed ~10.
Trying to communicate with bitcoind also becomes slow, bitcoin-cli getnetworkinfo | grep connections
at the start is instant but after awhile this command can take 30 seconds to execute.
Finally using nmon the system usage is very low except bitcoind is reading from the ssd at a rate of ~250 mbps but not doing much writing. The cpu usage is blocked by waiting io. The only thing I have tried was lowering the dbcache by 500mb thinking there wasn't enough free memory but it did not help.
bitcoin.conf:
# bitcoind configuration
# mainnet/testnet
testnet=0
# Bitcoind options
server=1
daemon=1
txindex=0
disablewallet=1
peerbloomfilters=1
# Connection settings
rpcuser=raspibolt
rpcpassword=****
rpcport=8332
rpcallowip=127.0.0.1
rpcbind=127.0.0.1:8332
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
# Raspberry Pi optimizations
dbcache=2560
maxorphantx=10
maxmempool=300
maxconnections=40
maxuploadtarget=5000
datadir=/mnt/hdd/bitcoin
Edit After several restarts the sync seems to be going faster than before, even after waiting. The disk reads are much lower with some writes as well. Not sure why lower read speeds results in faster syncing...
Eidt 2
I noticed after "leaving block file" it's operating at about 1/2 speed for awhile now. Look at the time stamps in the attached screenshot. Things slow down quite a bit after that.
txindex=1
. In my experience the early blocks always went quickly, and later blocks slowly (full blocks perhaps?). Also you did not say if you are sync'ing over Tor. I did most of the initial sync (IBD) without Tor because I was having unreliable peering; possibly caused by tor network congestion or outagesdbcache
should increase sync speeds. On a more basic level, it is maybe worth confirming the SSD is plugged into a USB3 port, and not a USB2 port. fwiw, I recently synced btcpayserver onto an rpi4 using an HDD, and it took about 2.5 days to complete.