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

blockchain: increase periodic flush interval #2215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kcalvinalvin
Copy link
Collaborator

The periodic flush intervals were set to 5 minutes previously which on average means that the node will flush every block when the node is caught up to the tip.

This put an overhead on the node after the node is caught up beyond the last checkpointed block as it'll start calling the periodic flush function. So while the node is still performing ibd, it'll be flushing every 5 minutes, hurting performance.

Changing this value to 48 hours doesn't hurt the node too much as the average worst case would be 288 blocks to reindex which is quick. For a decent computer, 48 hours should be enough time to sync all the blocks beyond the last checkpointed block as well. If not, 1-2 flushes don't hurt as much as flushing every 5 minutes.

The periodic flush intervals were set to 5 minutes previously which on
average means that the node will flush every block when the node is
caught up to the tip.

This put an overhead on the node after the node is caught up beyond the
last checkpointed block as it'll start calling the periodic flush
function.  So while the node is still performing ibd, it'll be flushing
every 5 minutes, hurting performance.

Changing this value to 48 hours doesn't hurt the node too much as the
average worst case would be 288 blocks to reindex which is quick.
For a decent computer, 48 hours should be enough time to sync all the
blocks beyond the last checkpointed block as well.  If not, 1-2 flushes
don't hurt as much as flushing every 5 minutes.
@kcalvinalvin kcalvinalvin force-pushed the 2024-07-17-increase-flush-time branch from a86c0ac to e130560 Compare July 17, 2024 05:51
@coveralls
Copy link

Pull Request Test Coverage Report for Build 9968910112

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 57.221%

Totals Coverage Status
Change from base Build 9957391466: 0.004%
Covered Lines: 29834
Relevant Lines: 52138

💛 - Coveralls

@Roasbeef
Copy link
Member

IIUC, with this most syncs wouldn't ever sync the utxo set cache until the very end (at least on a fast computer, possibly syncing over LAN). Let's say it crashes right before sync finishes, well before the 48 hour mark, how long would it take to reconstruct/reconcile the UTXO set cache on start up?

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

Successfully merging this pull request may close these issues.

3 participants