Skip to content
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

perf: Make kura drop old blocks from memory #5103

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

dima74
Copy link
Contributor

@dima74 dima74 commented Sep 25, 2024

Context

Meta: #5083
Fixes #4954

Solution

Currently kura stores all blocks in memory, which results in memory usage approximately 1.6KB per transaction, or 1.6GB per 1 million transactions. This PR changes to store only N last blocks in memory (128 by default). Other blocks will be loaded from the disk if needed. This improves memory usage to approximately 280 bytes per transaction or 0.26GB per 1 million transactions. Note that memory usage is still unbounded because of State::transactions map.

Checklist

  • I've read CONTRIBUTING.md.
  • (optional) I've written unit tests for the code changes.
  • All review comments have been resolved.
  • All CI checks pass.

@dima74 dima74 self-assigned this Sep 25, 2024
@dima74 dima74 force-pushed the diralik/kura-drop-old-blocks branch from 3aaecd1 to bcd75a9 Compare September 26, 2024 08:01
@Erigara Erigara self-assigned this Sep 26, 2024
Copy link
Contributor

@SamHSmith SamHSmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@SamHSmith SamHSmith force-pushed the diralik/kura-drop-old-blocks branch from bcd75a9 to 2b5c07a Compare September 27, 2024 12:13
@SamHSmith
Copy link
Contributor

I broke DCO by pushing the rebase button. Please rebase locally and then force push so that we can merge.

@dima74 dima74 force-pushed the diralik/kura-drop-old-blocks branch from 2b5c07a to 492fd5c Compare September 27, 2024 13:29
@dima74 dima74 merged commit 1c7160a into hyperledger-iroha:main Sep 27, 2024
15 of 16 checks passed
@dima74 dima74 deleted the diralik/kura-drop-old-blocks branch September 27, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kura cache
4 participants