Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate chainstate to SSD, or load it to memory #14904

Open
andronoob opened this Issue Dec 10, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@andronoob
Copy link

andronoob commented Dec 10, 2018

The UTXO database is stored in chainstate directory, which is intensively accessed.
A lot of PCs don't have a large volume SSD, instead, they have a combination of a moderate volume, turbo SSD and a large volume, slow HDD.
Syncing a full node on slow HDD seems to be very painfull...
A viable solution is migrating chainstate to SSD, while keeping blocks stored on HDD.
For PCs which are equipped with more than 8GB of RAM but without SSDs, there's another solution: loading all files placed in chainstate into memory before launching the full node.

@achow101

This comment has been minimized.

Copy link
Member

achow101 commented Dec 10, 2018

You can already do both of these things.

A viable solution is migrating chainstate to SSD, while keeping blocks stored on HDD.

You can start Bitcoin Core with -blocksdir to specify the location to store the blocks. The indexes and chainstate databases will remain in the datadir. So you can specify your datadir to be your SSD, and the blocksdir to be your hard drive.

For PCs which are equipped with more than 8GB of RAM but without SSDs, there's another solution: loading all files placed in chainstate into memory before launching the full node.

Use the -dbcache option to increase the size of the database cache. This will cache the chainstate database in memory. If it is larger than 8000 (8 GB), then the entire chainstate database will be cached in memory.

@andronoob

This comment has been minimized.

Copy link
Author

andronoob commented Dec 10, 2018

@achow101 Thank you for instruction!

You can start Bitcoin Core with -blocksdir to specify the location to store the blocks.

Is it possible to make this config available through GUI?

If it is larger than 8000 (8 GB), then the entire chainstate database will be cached in memory.

For scenarios like #12058, tricks like using cat chainstate/* > /dev/null to manually load all files in chainstate seem to work.
Additionally, what if the computer has exactly 8GB of total RAM? Will storing compressed UTXO database in memory help?
Though dbcache is available through GUI, I wish there could be some more hints for the user.

@promag

This comment has been minimized.

Copy link
Member

promag commented Dec 11, 2018

Is it possible to make this config available through GUI?

@andronoob this option is new, available from 0.17.0, which was added in #12653. In #14374 the information panel was also extended. I guess you could submit a feature request with the use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.