-
Notifications
You must be signed in to change notification settings - Fork 622
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
config: adjust shard cache sizes #10409
Merged
pugachAG
merged 2 commits into
near:master
from
pugachAG:fix-shard-cache-after-resharding
Jan 12, 2024
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 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 |
---|---|---|
|
@@ -240,17 +240,24 @@ impl Default for StoreConfig { | |
block_size: bytesize::ByteSize::kib(16), | ||
|
||
trie_cache: TrieCacheConfig { | ||
default_max_bytes: DEFAULT_SHARD_CACHE_TOTAL_SIZE_LIMIT, | ||
// Temporary solution to make contracts with heavy trie access | ||
// patterns on shard 3 more stable. It was chosen by the estimation | ||
// of the largest contract storage size we are aware as of 23/08/2022. | ||
// Consider removing after implementing flat storage. (#7327) | ||
// Note: on >= 1.34 nearcore version use 1_000_000_000 if you have | ||
// minimal hardware. | ||
per_shard_max_bytes: HashMap::from_iter([( | ||
ShardUId { version: 1, shard_id: 3 }, | ||
3_000_000_000, | ||
)]), | ||
default_max_bytes: 500_000_000, | ||
// TODO(resharding) The cache size needs to adjusted for every resharding. | ||
// Make that automatic e.g. by defining the minimum cache size per account rather than shard. | ||
per_shard_max_bytes: HashMap::from_iter([ | ||
pugachAG marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Temporary solution to make contracts with heavy trie access | ||
// patterns on shard 3 more stable. It was chosen by the estimation | ||
// of the largest contract storage size we are aware as of 23/08/2022. | ||
// Note: on >= 1.34 nearcore version use 1_000_000_000 if you have | ||
// minimal hardware. | ||
// In simple nightshade the heavy contract "token.sweat" is in shard 3 | ||
(ShardUId { version: 1, shard_id: 3 }, 3_000_000_000), | ||
// In simple nightshade v2 the heavy contract "token.sweat" is in shard 4 | ||
(ShardUId { version: 2, shard_id: 4 }, 3_000_000_000), | ||
// Shard 1 is dedicated to aurora and it had very few cache | ||
// misses even with cache size of only 50MB | ||
(ShardUId { version: 1, shard_id: 1 }, 50_000_000), | ||
(ShardUId { version: 2, shard_id: 1 }, 50_000_000), | ||
Comment on lines
+258
to
+259
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it the default now? Does it need to be set explicitly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope, I've changed the default via |
||
]), | ||
shard_cache_deletions_queue_capacity: DEFAULT_SHARD_CACHE_DELETIONS_QUEUE_CAPACITY, | ||
}, | ||
|
||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not for this pr, but bytesize is a nice type safe helper for dealing with bytes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#10412