-
Notifications
You must be signed in to change notification settings - Fork 624
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
Increase cache for RockDB by column #5212
Merged
near-bulldozer
merged 7 commits into
near:master
from
pmnoxx:piotr-increase-cache-for-colstate
Nov 13, 2021
Merged
Increase cache for RockDB by column #5212
near-bulldozer
merged 7 commits into
near:master
from
pmnoxx:piotr-increase-cache-for-colstate
Nov 13, 2021
Conversation
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
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.
Thanks!
@bowenwang1996 Ok, I updated the cache size. |
bowenwang1996
approved these changes
Nov 12, 2021
pmnoxx
added a commit
that referenced
this pull request
Nov 20, 2021
We recently found out that our rockdb is not efficient enough. Therefore we would like to increase cache size of specific columns. In this PR we will increase cache size for `DBCol::ColState` to 128mb. We can adjust that cache size later, but we try to be conservative in memory usage. Some testing should be done to determine optimize cache sizes. Closes #5203
pmnoxx
added
A-store
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
P-low
Priority: low
labels
Dec 5, 2021
near-bulldozer bot
pushed a commit
that referenced
this pull request
Dec 8, 2021
Increase trie cache size to mitigate receipts undercharging issue. ## Validity We can increase cache size to 50_000, so the theoretical occupied size is 50_000 * 4 (num_shards) * 4_000 = 800 MB. In reality, `/usr/bin/time -v ` shows **520 -> 1070 MB** RAM growth which seem to be caused by #5212. This change have an impact like 30 MB. I've additionally checked that cache is full on my runs. ## Speedup On the sample of 30 receipts we considered, we have the following characteristics: ``` default settings: summary time = 3.3s, avg undercharging = 101 increase state cache size: summary time = 0.67s, avg undercharging = 21 increase state cache size + trie cache size = 50k: summary time = 0.5s, avg undercharging = 11.5 increase state cache size + trie cache size = 100k + reduce max value size to 1k: summary time = 0.3s, avg undercharging = 6.9 ``` For now, let's just increase cache size. On this sample we reduce undercharging 2x and summary execution time 1.3x. ## Testing * checking that cache is full; * existing tests, * estimating `/usr/bin/time -v ./state-viewer apply_range --start_index 54051433 --end_index 54053438 --shard_id 3`
bowenwang1996
pushed a commit
that referenced
this pull request
Dec 20, 2021
Increase trie cache size to mitigate receipts undercharging issue. ## Validity We can increase cache size to 50_000, so the theoretical occupied size is 50_000 * 4 (num_shards) * 4_000 = 800 MB. In reality, `/usr/bin/time -v ` shows **520 -> 1070 MB** RAM growth which seem to be caused by #5212. This change have an impact like 30 MB. I've additionally checked that cache is full on my runs. ## Speedup On the sample of 30 receipts we considered, we have the following characteristics: ``` default settings: summary time = 3.3s, avg undercharging = 101 increase state cache size: summary time = 0.67s, avg undercharging = 21 increase state cache size + trie cache size = 50k: summary time = 0.5s, avg undercharging = 11.5 increase state cache size + trie cache size = 100k + reduce max value size to 1k: summary time = 0.3s, avg undercharging = 6.9 ``` For now, let's just increase cache size. On this sample we reduce undercharging 2x and summary execution time 1.3x. ## Testing * checking that cache is full; * existing tests, * estimating `/usr/bin/time -v ./state-viewer apply_range --start_index 54051433 --end_index 54053438 --shard_id 3`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
We recently found out that our rockdb is not efficient enough.
Therefore we would like to increase cache size of specific columns.
In this PR we will increase cache size for
DBCol::ColState
to 128mb.We can adjust that cache size later, but we try to be conservative in memory usage.
Some testing should be done to determine optimize cache sizes.
Closes #5203