-
Notifications
You must be signed in to change notification settings - Fork 44
docs/node/run-your-node/advanced: Add new pruning section #1526
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # Pruning State | ||
|
|
||
| To reduce hardware requirements and improve the overall latency of the node, | ||
| operators are encouraged to prune their state (unless also serving historical | ||
| state). | ||
|
|
||
| As will be explained in the following sections, pruning should be configured from | ||
| the start, i.e. late changes to the pruning configuration may not be optimal for | ||
| the node's health. | ||
|
|
||
| ## Consensus Pruning | ||
|
|
||
| To configure pruning of the consensus data amend your node's configuration with: | ||
|
|
||
| ```yaml | ||
| # ... sections not relevant are omitted ... | ||
| consensus: | ||
| # ... sections not relevant are omitted ... | ||
| prune: | ||
| strategy: "keep_n" | ||
| num_kept: <n> | ||
| ``` | ||
|
|
||
| where `<n>` is the number of blocks and state versions that will be kept. | ||
|
|
||
| ### Suggested Pruning Configuration | ||
|
|
||
| For normal node operation, the minimum requirements is `n=250_000`. However, | ||
| it is recommended to set it to `n=400_000`. Assuming blocks are produced every 6 | ||
| seconds, the latter corresponds to preserving 1 month of the consensus data. | ||
|
|
||
| Operators that are not resource-restrained and want to contribute to the overall | ||
| network health are encouraged to set `n=5_000_000` (approximately 1 year of data). | ||
|
|
||
| ### Late Pruning | ||
|
|
||
| Due to the [LSM Tree][] design of the underlying databases, enabling pruning after | ||
| your node has been running for a while, or changing configuration to retain less data, | ||
| may not work as expected. | ||
|
|
||
| To change pruning configuration operators must follow this steps: | ||
|
|
||
| 1. Gracefuly shutdown the node (validators should take [special care][graceful shutdown]). | ||
|
martintomazic marked this conversation as resolved.
|
||
| 2. Configure pruning as described in the [Consensus Pruning](#consensus-pruning) section above. | ||
| 3. Run offline [pruning command]. | ||
| 4. Run the [compaction command]. | ||
| 5. Start the node again. | ||
|
|
||
| [LSM tree]: https://en.wikipedia.org/wiki/Log-structured_merge-tree | ||
| [graceful shutdown]: ../maintenance/shutting-down-a-node.md | ||
| [pruning command]: https://github.com/oasisprotocol/oasis-core/blob/master/docs/oasis-node/cli.md#prune-experimental | ||
| [compaction command]: https://github.com/oasisprotocol/oasis-core/blob/master/docs/oasis-node/cli.md#compact-experimental | ||
|
|
||
| ## ParaTime Pruning | ||
|
|
||
|
martintomazic marked this conversation as resolved.
|
||
| To configure pruning of the ParaTime data amend your node's configuration with: | ||
|
|
||
| ```yaml | ||
| # ... sections not relevant are omitted ... | ||
| runtime: | ||
| # ... sections not relevant are omitted ... | ||
| prune: | ||
| strategy: "keep_last" | ||
| num_kept: <n> | ||
| ``` | ||
|
|
||
| where `<n>` is the number of ParaTime's state versions that will be kept. | ||
|
|
||
| ### Suggested Pruning Configuration | ||
|
|
||
| ParaTime state is much larger than the consensus state. As a consequence, as the | ||
| number of versions in the state database grows, pruning becomes slower and slower. | ||
| For this reason **ParaTime state pruning must be configured | ||
| from the start or not configured at all**. | ||
|
|
||
| To configure ParaTime pruning it is recommended to set `n=250_000`. The maximum value is | ||
| `n=400_000`. If you need to preserve more data (e.g. nodes serving historical | ||
| state) you will have to keep the entire ParaTime's state from the genesis. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.