Skip to content

Commit

Permalink
feat: Change default shard trie cache size to 500MB (#10373)
Browse files Browse the repository at this point in the history
Current value is 50MB which might not be enough when the shard is
overloaded. One example when this can be an issue is when delayed
receipts queue grows to 20k+ items, which already happened during NEAT
inscription load. Insufficient cache size results in increased number of
disk reads to State rocksdb column. That increases chunk application
time which results in more missed chunks.
This only applies to shards 0,1,2 since we have an overwrite for shard
3. So overall expected RAM increase is 3 * (500 - 50) = 1350MB.
  • Loading branch information
pugachAG authored Jan 2, 2024
1 parent 7365af4 commit afa5d00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/store/src/trie/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use tracing::error;

/// Default memory limit, if nothing else is configured.
/// It is chosen to correspond roughly to the old limit, which was
/// 50k entries * TRIE_LIMIT_CACHED_VALUE_SIZE.
/// 500k entries * TRIE_LIMIT_CACHED_VALUE_SIZE.
pub(crate) const DEFAULT_SHARD_CACHE_TOTAL_SIZE_LIMIT: u64 =
if cfg!(feature = "no_cache") { 1 } else { 50_000_000 };
if cfg!(feature = "no_cache") { 1 } else { 500_000_000 };

/// Capacity for the deletions queue.
/// It is chosen to fit all hashes of deleted nodes for 3 completely full blocks.
Expand Down

0 comments on commit afa5d00

Please sign in to comment.