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

disable read cache while populating stakes cache on load #482

Merged
merged 6 commits into from
Mar 29, 2024

Conversation

jeffwashington
Copy link

Problem

stakes cache reads tons of accounts. These fill up the read cache. We then spend time evicting all these accounts, which hurts performance of startup and tx processing.

Summary of Changes

skip populating the read cache while loading stake accounts.

Fixes #

@jeffwashington jeffwashington marked this pull request as ready for review March 28, 2024 22:30
accounts-db/src/accounts_db.rs Outdated Show resolved Hide resolved
accounts-db/src/accounts_db.rs Outdated Show resolved Hide resolved
@jeffwashington jeffwashington changed the title dsiable read cache while populating stakes cache on load disable read cache while populating stakes cache on load Mar 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.8%. Comparing base (e261e27) to head (f566b04).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #482     +/-   ##
=========================================
- Coverage    81.8%    81.8%   -0.1%     
=========================================
  Files         842      842             
  Lines      228436   228442      +6     
=========================================
- Hits       187063   187026     -37     
- Misses      41373    41416     +43     

@alessandrod
Copy link

Adding the disable_read_cache_updates field seems fine for this use case, but how about adding it as an explicit parameter to some load_account*() variant? Tx execution will likely want something like this too to implement #180, and there I don't think we can set a db-global bool

@brooksprumo
Copy link

[..] how about adding it as an explicit parameter to some load_account*() variant?

This also sounds good to me.

HaoranYi
HaoranYi previously approved these changes Mar 29, 2024
Copy link

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

lgtm.
It is a tradeoff. I like the simplicity of this change, which will be easy to backport.

@brooksprumo
Copy link

[..] which will be easy to backport.

Probably not a candidate to backport. v1.18 is rolling out to mnb very soon. So we should only be backporting critical bug fixes. More details in Discord: https://discord.com/channels/428295358100013066/439194979856809985/1222663250206789673.

runtime/src/bank.rs Outdated Show resolved Hide resolved
accounts-db/src/accounts_db.rs Outdated Show resolved Hide resolved
Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

:shipit:

@jeffwashington jeffwashington merged commit 18c32ab into anza-xyz:master Mar 29, 2024
37 checks passed
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.

5 participants