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

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

luke-jr
Copy link
Member

@luke-jr luke-jr commented Nov 11, 2017

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

Alternative to #11359

…n soon after

Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.
// 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%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Sjors
Copy link
Member

Sjors commented Dec 7, 2017

Some IRC discussion.

Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 10, 2018
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 bitcoin#11658.
Sjors added a commit to Sjors/bitcoin that referenced this pull request Feb 10, 2018
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 bitcoin#11658.
@Sjors
Copy link
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
Copy link
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.

@sipa
Copy link
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
Copy link
Member

promag commented Jul 7, 2018

utACK ac51a26. Improvement looks good.

@ajtowns
Copy link
Contributor

ajtowns commented Jul 12, 2018

utACK ac51a26

@achow101
Copy link
Member

utACK ac51a26

@sipa sipa merged commit ac51a26 into bitcoin:master Jul 14, 2018
sipa added a commit that referenced this pull request Jul 14, 2018
…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
@ajtowns
Copy link
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
Copy link

How use this ?

@Sjors
Copy link
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).

jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Sep 13, 2019
…n soon after

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

Backport of Bitcoin Core PR11658
bitcoin/bitcoin#11658

Test Plan:
```
make check
```

Reviewers: Fabien, #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D3986
jonspock pushed a commit to jonspock/devault that referenced this pull request Dec 22, 2019
…n soon after

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

Backport of Bitcoin Core PR11658
bitcoin/bitcoin#11658

Test Plan:
```
make check
```

Reviewers: Fabien, #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D3986
proteanx pushed a commit to devaultcrypto/devault that referenced this pull request Dec 23, 2019
…n soon after

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

Backport of Bitcoin Core PR11658
bitcoin/bitcoin#11658

Test Plan:
```
make check
```

Reviewers: Fabien, #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D3986
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 19, 2020
…to avoid 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 bitcoin#11359

Tree-SHA512: 631e4e8f94f5699e98a2eff07204aa2b3b2325b2d92e8236b8c8d6a6730737a346e0ad86024e705f5a665b25e873ab0970ce7396740328a437c060f99e9ba4d9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 24, 2020
…to avoid 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 bitcoin#11359

Tree-SHA512: 631e4e8f94f5699e98a2eff07204aa2b3b2325b2d92e8236b8c8d6a6730737a346e0ad86024e705f5a665b25e873ab0970ce7396740328a437c060f99e9ba4d9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 27, 2020
…to avoid 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 bitcoin#11359

Tree-SHA512: 631e4e8f94f5699e98a2eff07204aa2b3b2325b2d92e8236b8c8d6a6730737a346e0ad86024e705f5a665b25e873ab0970ce7396740328a437c060f99e9ba4d9
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Jul 27, 2020
…to avoid 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 bitcoin#11359

Tree-SHA512: 631e4e8f94f5699e98a2eff07204aa2b3b2325b2d92e8236b8c8d6a6730737a346e0ad86024e705f5a665b25e873ab0970ce7396740328a437c060f99e9ba4d9
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Jul 27, 2020
…to avoid 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 bitcoin#11359

Tree-SHA512: 631e4e8f94f5699e98a2eff07204aa2b3b2325b2d92e8236b8c8d6a6730737a346e0ad86024e705f5a665b25e873ab0970ce7396740328a437c060f99e9ba4d9
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants