Skip to content

Commit

Permalink
Increase default trie cache size to 1GiB (#6546)
Browse files Browse the repository at this point in the history
The default trie cache size before was set to `64MiB`, which is quite
low to achieve real speed ups. `1GiB` should be a reasonable number as
the requirements for validators/collators/full nodes are much higher
when it comes to minimum memory requirements. Also the cache will not
use `1GiB` from the start and fills over time. The setting can be
changed by setting `--trie-cache-size BYTE_SIZE`.

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
bkchr and actions-user authored Nov 20, 2024
1 parent ca8beae commit 65a92ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
13 changes: 13 additions & 0 deletions prdoc/pr_6546.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: Increase default trie cache size to 1GiB
doc:
- audience: Node Operator
description: "The default trie cache size before was set to `64MiB`, which is quite\
\ low to achieve real speed ups. `1GiB` should be a reasonable number as the requirements\
\ for validators/collators/full nodes are much higher when it comes to minimum\
\ memory requirements. Also the cache will not use `1GiB` from the start and fills\
\ over time. The setting can be changed by setting `--trie-cache-size BYTE_SIZE`.\
The CLI option `--state-cache-size` is also removed, which was not having any effect anymore.\r\
\n"
crates:
- name: sc-cli
bump: patch
10 changes: 1 addition & 9 deletions substrate/client/cli/src/params/import_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,13 @@ pub struct ImportParams {
/// Specify the state cache size.
///
/// Providing `0` will disable the cache.
#[arg(long, value_name = "Bytes", default_value_t = 67108864)]
#[arg(long, value_name = "Bytes", default_value_t = 1024 * 1024 * 1024)]
pub trie_cache_size: usize,

/// DEPRECATED: switch to `--trie-cache-size`.
#[arg(long)]
state_cache_size: Option<usize>,
}

impl ImportParams {
/// Specify the trie cache maximum size.
pub fn trie_cache_maximum_size(&self) -> Option<usize> {
if self.state_cache_size.is_some() {
eprintln!("`--state-cache-size` was deprecated. Please switch to `--trie-cache-size`.");
}

if self.trie_cache_size == 0 {
None
} else {
Expand Down

0 comments on commit 65a92ba

Please sign in to comment.