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

Increase size of default leveldb cache to improve random read performance #2238

Closed
barton2526 opened this issue Jul 16, 2021 · 1 comment · Fixed by #2507
Closed

Increase size of default leveldb cache to improve random read performance #2238

barton2526 opened this issue Jul 16, 2021 · 1 comment · Fixed by #2507
Assignees
Milestone

Comments

@barton2526
Copy link
Member

This continues a discussion from Slack yesterday. Our current dbcache parameter defaults to 25 MB, which has not been changed since we forked off from Blackcoin in 2014. Bitcoin had a leveldb cache size of 100 MB in 2014, then bumped it to 300 MB in 2016 (morcos/bitcoin@32cab91) and finally to 450 MB in 2017 (bitcoin/bitcoin#10133).

I am in favor of a more conservative size, and I think 100 MB would be a good starting point to see what performance benefits we can expect from this change. Leveldb's internal benchmarks (http://www.lmdb.tech/bench/microbench/benchmark.html) suggest greatly improved read speeds with a larger cache (1.29x for sequential and 1.47x for random). If we can benchmark ourselves to get real world numbers for the change that would be even better.

As a reminder, the dbcache parameter can be easily changed by the user, so memory constrained devices can continue to use 25 MB (or even lower) if they do not want this change.

@barton2526
Copy link
Member Author

Related: checking the code, we currently have a TODO to implement the -reindex parameter. We could perform more accurate testing of this change (reindexing the block files with no network variables) with -reindex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants