6

Bitcoin is very disk intense 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 (http://doc.gnu-darwin.org/am_conf/cachesize.html) or do something else to improve cache performance.

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

edit: 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. – David Schwartz Feb 23 '12 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 Feb 24 '12 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. – David Schwartz Feb 24 '12 at 22:42
  • Hmm I tested it at least five times and it always took so long. – kermit Mar 8 '12 at 16:29
6

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.

2

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.

0

for the record:

file DB_CONFIG:
set_lg_dir database
set_lk_max_locks 120000
set_cachesize 2 524288000 1

--> 2.5GB cache

http://docs.oracle.com/cd/E17076_02/html/api_reference/C/set_cachesize_parameter.html

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, privacy policy and cookie policy

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