2

I've been trying to speed up my node sync by increasing the dbcache. However my node tends to crash overnight. My system is running ubuntu 18.04, 4GM of ram bitcoin core v0.18.

I've tried bitcoind -dbcache=4000, also tried setting it to 3000 and 2500. All have crashed overnight.

Any thoughts on improving sync time using this or other methods?

1 Answer 1

5

You are allocating far too much dbcache. If you allocate 4000 MB to the dbcache, you will use up all of your RAM and it will crash. Your operating system needs RAM, Bitcoin Core itself needs RAM outside of the dbcache. I would highly recommend that you do not set a dbcache at all as 4 GB is really not enough RAM to handle a larger dbcache, Bitcoin Core's other RAM usage, operating system RAM usage, and whatever else may be running on your machine.

I suggest that you start Bitcoin Core without dbcache and check what your RAM usage is (using top or Ubuntu's system monitor). See how much RAM is being used and how much is free. Then you can set a higher dbcache if you have enough free.

Bitcoin Core has a few other suggestions for reducing memory usage. You can set maxmempool=<n> to a number less than the default 300. You can reduce the maximum number of connections by setting maxconnections=<n> to a number smaller than 125. Note that that only is helpful if you happen to have a lot of incoming connections. Lastly you can reduce the number of threads being used for signature validiation by using par=<n> and setting it to a number smaller than the number of cores your CPU has.

14
  • Thanks for the advice, I have been watching my ram usage using top and started bitcoind without any additional options bitcoind. Jul 16, 2019 at 21:13
  • However, as I watch my top and log file, my load average increases steadily going to 4.17, 2.97, 1.36 and my cache goes well above 300mb, it seems to hit about 380mb at which point it uses up all my system ram and my server crashes. I'm now starting with bitcoind dbcache=100 to see if this prevents the cache from growing out of control. Do you know if there is a config option to set the cache size in a file? Jul 16, 2019 at 21:19
  • The command line function is not limiting the cache size. There must be a database configuration file that has been set to too high a cache limit. Any ideas how I could find that file? Jul 16, 2019 at 21:30
  • I've tried specifying a cache size by creating a DB_CONFIG file in the .bitcoin directory. Jul 16, 2019 at 21:40
  • My cache continues to increase in size regardless of what I set it to, this time I tried 25 megabites, here is my log file from after the crash, it just shows a cache update: 2019-07-16T22:39:10Z UpdateTip: new best=0000000000000000000ef9baad2eda04785ee40c55788def6de7e76bc90ad5b0 height=548707 version=0x20000000 log2_work=89.96435 tx=353876079 date='2018-11-04T07:37:51Z' progress=0.870169 cache=110.8MiB(850392txo) Jul 16, 2019 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.