1

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=c4w0Mh2q
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

nmon

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.enter image description here

3
  • Less than 50% sync'd after only 4d? So >40%? I'd say that's pretty good. It took me about 4 weeks to sync, though i desired and configured 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 outages
    – Donn Lee
    Apr 18 '21 at 8:01
  • I'm not using tor. I lowered my dbindex yesterday and kept monitoring it. went from 50 to 70 last night. I'm pretty convinced there's something getting 'stuck' or a memory leak, etc. Woke up this morning and it's slow again.
    – that_guy
    Apr 18 '21 at 12:57
  • Increasing dbcache 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.
    – chytrik
    Apr 18 '21 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.