-
Notifications
You must be signed in to change notification settings - Fork 259
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
accounts-db: Benchmark cache evictions #4045
accounts-db: Benchmark cache evictions #4045
Conversation
100c57d
to
8206e16
Compare
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.
Looks great! Left some comments
2766162
to
42ca375
Compare
e50fa20
to
ba708a3
Compare
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.
I think the benches look good to me. Can you share some results? I'm interested 😸
2bf4cd2
to
f3b9d49
Compare
Here we go with the results. 🙂
|
f3b9d49
to
42761bd
Compare
42761bd
to
8caedac
Compare
Latest benchmarks:
|
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.
Overall looks good. I think we can add some comments to the _evictions
bench on its intent and what is/is not being benchmarked, and then we can get this merged in. We can always tweak it more later as we learn more.
681bae7
to
e1e4ede
Compare
e1e4ede
to
4419c1d
Compare
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.
Looks good to me! Thanks for the work here 😸
The already existing `concurrent_{read,scan}_write` benchmarks are not sufficient for benchmarking the eviction and evaluating what kind of eviction policy performs the best, because they don't fill up the cache, so eviction never happens. The number of readers in that benchmark is low (5) and there are no writer threads causing more contention. The cache is RW-locked, so bencharking only concurrent reads doesn't push it to the limits. Add new benchmarks which are made with measuring contention in mind: - `read_only_accounts_cache` - benchmarks read-only cache loads and stores without causing eviction. - `read_only_accounts_cache_lo_hi` - benchmarks read-only cache eviction with low and high thresholds. After each eviction, enough stores need to be made to reach the difference between the low and high threshold, triggering another eviction. Aims to simulate contention in a manner close to what occurs on validators. - `read_only_accounts_cache_hi` - benchmarks read-only cache eviction without differentiating between low and high thresholds. Each store triggers another eviction immediately. Measures the absolutely worst-case scenario, which may not reflect actual conditions in validators.
4419c1d
to
506b666
Compare
The already existing
concurrent_{read,scan}_write
benchmarks are not sufficient for benchmarking the eviction and evaluating what kind of eviction policy performs the best, because they don't fill up the cache, so eviction never happens. The number of readers in that benchmark is low (5) and there are no writer threads causing more contention. The cache is RW-locked, so bencharking only concurrent reads doesn't push it to the limits.Add new benchmarks which are made with measuring contention in mind:
read_only_accounts_cache
- benchmarks read-only cache loads and stores without causing eviction.read_only_accounts_cache_lo_hi
- benchmarks read-only cache eviction with low and high thresholds. After each eviction, enough stores need to be made to reach the difference between the low and high threshold, triggering another eviction. Aims to simulate contention in a manner close to what occurs on validators.read_only_accounts_cache_hi
- benchmarks read-only cache eviction without differentiating between low and high thresholds. Each store triggers another eviction immediately. Measures the absolutely worst-case scenario, which may not reflect actual conditions in validators.