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

Cache account count #2511

Merged
merged 3 commits into from
Jan 29, 2020
Merged

Conversation

wezrule
Copy link
Contributor

@wezrule wezrule commented Jan 24, 2020

This is useful for 2 areas: node telemetry as it is one of the metrics and the only one currently requiring a DB call to retrieve. Also helps RocksDB because it had to cache this value in the DB for fast retrieval. Even better is that we are already iterating over all accounts during start-up for rep_weights so it has negligible start-up cost too.

Tested over a half hour run on live, seemed ok. Note if testing is that the values may seem out of sync (accounts_count RPC & --debug_account_count CLI command), but this is because the write transaction can be held for a long time before committing while the cache is updated real-time.

@wezrule wezrule added performance Performance/resource utilization improvement database Relates to lmdb or rocksdb labels Jan 24, 2020
@wezrule wezrule added this to the V21.0 milestone Jan 24, 2020
@wezrule wezrule self-assigned this Jan 24, 2020
@wezrule wezrule merged commit 9ceef40 into nanocurrency:develop Jan 29, 2020
@wezrule wezrule deleted the cache_account_count branch January 29, 2020 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Relates to lmdb or rocksdb performance Performance/resource utilization improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants