Bitcoin is very disk-intensive and that slows it down. It seems to flush data to disk often thus preventing proper caching. With the datadir on a RAMdisk it is much faster.

Is it possible to increase the db cache size or do something else to improve cache performance.

Of course it would be nice to keep the wallet and important data saved but I would not mind the blockchain to be heavily cached.

I'm asking mainly about Windows OS.

  • It's not really clear what you're asking. Very disk intensive when? During startup? When downloading the block chain? When processing GUI requests? The OS should already be caching all disk data that it can fit in memory anyway. Commented Feb 23, 2012 at 10:32
  • A getnewaddress took 20 secs or so... I reduced virtual memory and changed the cache settings to "server" - not sure if it did anything but it is much faster now. Will close the question.
    – kermit
    Commented Feb 24, 2012 at 19:32
  • 1
    That was likely because you have it set to create several hundred addresses when it runs out. It didn't take as long after that because it was giving you the addresses it had pre-generated. Commented Feb 24, 2012 at 22:42
  • Hmm I tested it at least five times and it always took so long.
    – kermit
    Commented Mar 8, 2012 at 16:29

3 Answers 3


The very recently released bitcoin v0.6.0 has modified bdb cache settings (25 megabytes by default), and provides a way to change this via the command-line option -dbcache=N, with N a number in megabytes.

This change caused a very significant speedup for synchronizing the block chain indeed.

  • Can setting the number of MB assigned to the cache to be greater than the number of MB of RAM of the machine further increase the speed of syncing? E.g. Would setting the cache at 2500 MB (instead of 2000 MB) on my laptop that has only 2GB of RAM increase the speed of syncing?
    – John Smith
    Commented Jan 14, 2021 at 15:45
  • 2
    @JerzyBrzóska That is a very bad idea. You can set it higher, but at that point your system will either run out of memory and kill things, or it will start using swap space which will cause far more slowdown than just using a smaller cache. Commented Jan 14, 2021 at 17:49

Bitcoin (through BerkleyDB) frequently flushes writes to disc to main transaction integrity in wallet.dat and the blockchain databases. The operating system can cache the entire blockchain normally,

I have restarted Bitcoin several times and had it start instantly because the entire blockchain is already cached by the OS.


for the record:

set_lg_dir database
set_lk_max_locks 120000
set_cachesize 2 524288000 1

--> 2.5GB cache


For versions higher v0.6 Pieter's way sure is better. This still could be useful for older versions.

Unfortunately I can't get it to work with Namecoin 3.50

Your Answer

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

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