Skip to content

Commit 65a92ba

Browse files
bkchractions-user
andauthored
Increase default trie cache size to 1GiB (#6546)
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 <action@github.com>
1 parent ca8beae commit 65a92ba

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

prdoc/pr_6546.prdoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
title: Increase default trie cache size to 1GiB
2+
doc:
3+
- audience: Node Operator
4+
description: "The default trie cache size before was set to `64MiB`, which is quite\
5+
\ low to achieve real speed ups. `1GiB` should be a reasonable number as the requirements\
6+
\ for validators/collators/full nodes are much higher when it comes to minimum\
7+
\ memory requirements. Also the cache will not use `1GiB` from the start and fills\
8+
\ over time. The setting can be changed by setting `--trie-cache-size BYTE_SIZE`.\
9+
The CLI option `--state-cache-size` is also removed, which was not having any effect anymore.\r\
10+
\n"
11+
crates:
12+
- name: sc-cli
13+
bump: patch

substrate/client/cli/src/params/import_params.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,13 @@ pub struct ImportParams {
7878
/// Specify the state cache size.
7979
///
8080
/// Providing `0` will disable the cache.
81-
#[arg(long, value_name = "Bytes", default_value_t = 67108864)]
81+
#[arg(long, value_name = "Bytes", default_value_t = 1024 * 1024 * 1024)]
8282
pub trie_cache_size: usize,
83-
84-
/// DEPRECATED: switch to `--trie-cache-size`.
85-
#[arg(long)]
86-
state_cache_size: Option<usize>,
8783
}
8884

8985
impl ImportParams {
9086
/// Specify the trie cache maximum size.
9187
pub fn trie_cache_maximum_size(&self) -> Option<usize> {
92-
if self.state_cache_size.is_some() {
93-
eprintln!("`--state-cache-size` was deprecated. Please switch to `--trie-cache-size`.");
94-
}
95-
9688
if self.trie_cache_size == 0 {
9789
None
9890
} else {

0 commit comments

Comments
 (0)