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

During IBD, when doing pruning, prune 10% extra to avoid pruning again soon after #11658

Merged
merged 1 commit into from Jul 14, 2018

Conversation

Projects
None yet
9 participants
@luke-jr
Member

luke-jr commented Nov 11, 2017

Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

Alternative to #11359

During IBD, when doing pruning, prune 10% extra to avoid pruning agai…
…n soon after

Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

@fanquake fanquake added the Validation label Nov 11, 2017

// values, we should not prune too rapidly.
// So when pruning in IBD, increase the buffer a bit to avoid a re-prune too soon.
if (IsInitialBlockDownload()) {
// Since this is only relevant during IBD, we use a fixed 10%

This comment has been minimized.

@promag

promag Nov 15, 2017

Member

BTW, why 10%, in IBD could be even more no?

@promag

promag Nov 15, 2017

Member

BTW, why 10%, in IBD could be even more no?

@Sjors

This comment has been minimized.

Show comment
Hide comment
@Sjors
Member

Sjors commented Dec 7, 2017

Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 10, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 10, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 10, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 10, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 19, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 19, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 19, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Mar 12, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Mar 26, 2018

Prune more aggressively during IBD
Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

During IBD we now prune based on the worst case size of the remaining blocks, but no further than
the minimum prune size of 550 MB.

Based on @luke-jr's #11658.
@Sjors

This comment has been minimized.

Show comment
Hide comment
@Sjors

Sjors May 28, 2018

Member

tACK ac51a26 (although I rebased it on master).

This performs better than master in my tests so far: #12404 (comment)

@promag wrote:

BTW, why 10%, in IBD could be even more no?

I tried this in #12404 and there seems to be negative side effects that I can't explain. I'd say this PR is a safer choice for now.

@luke-jr you may want to borrow the release note I added to my PR, though that can be done later.

Member

Sjors commented May 28, 2018

tACK ac51a26 (although I rebased it on master).

This performs better than master in my tests so far: #12404 (comment)

@promag wrote:

BTW, why 10%, in IBD could be even more no?

I tried this in #12404 and there seems to be negative side effects that I can't explain. I'd say this PR is a safer choice for now.

@luke-jr you may want to borrow the release note I added to my PR, though that can be done later.

@Sjors

This comment has been minimized.

Show comment
Hide comment
@Sjors

Sjors Jun 14, 2018

Member

I'm currently racing two Orange Pi's with 2 GB memory. This PR means cache rarely grows beyond 300 MB, but it's still a bit faster than master; after 5 days it's at 2018-01-27 vs. master is still at 2017-11-25.

Member

Sjors commented Jun 14, 2018

I'm currently racing two Orange Pi's with 2 GB memory. This PR means cache rarely grows beyond 300 MB, but it's still a bit faster than master; after 5 days it's at 2018-01-27 vs. master is still at 2017-11-25.

@laanwj laanwj added this to Blockers in High-priority for review Jul 5, 2018

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Jul 6, 2018

Member

utACK ac51a26. This should be a safe first improvement. We can later make the overshoot value configurable or smarter, but this should already be a lot better.

Member

sipa commented Jul 6, 2018

utACK ac51a26. This should be a safe first improvement. We can later make the overshoot value configurable or smarter, but this should already be a lot better.

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Jul 7, 2018

Member

utACK ac51a26. Improvement looks good.

Member

promag commented Jul 7, 2018

utACK ac51a26. Improvement looks good.

@ajtowns

This comment has been minimized.

Show comment
Hide comment
@ajtowns

ajtowns Jul 12, 2018

Contributor

utACK ac51a26

Contributor

ajtowns commented Jul 12, 2018

utACK ac51a26

@achow101

This comment has been minimized.

Show comment
Hide comment
@achow101
Member

achow101 commented Jul 13, 2018

utACK ac51a26

@sipa sipa merged commit ac51a26 into bitcoin:master Jul 14, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

sipa added a commit that referenced this pull request Jul 14, 2018

Merge #11658: During IBD, when doing pruning, prune 10% extra to avoi…
…d pruning again soon after

ac51a26 During IBD, when doing pruning, prune 10% extra to avoid pruning again soon after (Luke Dashjr)

Pull request description:

  Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.

  Alternative to #11359

Tree-SHA512: 631e4e8f94f5699e98a2eff07204aa2b3b2325b2d92e8236b8c8d6a6730737a346e0ad86024e705f5a665b25e873ab0970ce7396740328a437c060f99e9ba4d9

@fanquake fanquake removed this from Blockers in High-priority for review Jul 14, 2018

@ajtowns

This comment has been minimized.

Show comment
Hide comment
@ajtowns

ajtowns Jul 16, 2018

Contributor

Post-merge tested ACK.

I ran this on some memory-constrained Linodes (dbcache=1000, prune=5000, and both connect= to a single nearby fully synced node; 2GB memory, 50GB disk), and saw a reasonably consistent 15% performance increase compared to not having this patch.

Contributor

ajtowns commented Jul 16, 2018

Post-merge tested ACK.

I ran this on some memory-constrained Linodes (dbcache=1000, prune=5000, and both connect= to a single nearby fully synced node; 2GB memory, 50GB disk), and saw a reasonably consistent 15% performance increase compared to not having this patch.

@martinpgaunt

This comment has been minimized.

Show comment
Hide comment
@martinpgaunt

martinpgaunt Jul 16, 2018

How use this ?

martinpgaunt commented Jul 16, 2018

How use this ?

@bitcoin bitcoin deleted a comment from martinpgaunt Jul 16, 2018

@Sjors

This comment has been minimized.

Show comment
Hide comment
@Sjors

Sjors Jul 16, 2018

Member

@martinpgaunt it just works, if you download Bitcoin Core 0.17 when it comes out in a couple of weeks (or a bit later).

Member

Sjors commented Jul 16, 2018

@martinpgaunt it just works, if you download Bitcoin Core 0.17 when it comes out in a couple of weeks (or a bit later).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment