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

store: write benchmarks /store and /store/v2 with different load scenarios #10297

Closed
4 tasks done
Tracked by #10360 ...
odeke-em opened this issue Oct 4, 2021 · 7 comments
Closed
4 tasks done
Tracked by #10360 ...
Assignees
Labels
T: Performance Performance improvements

Comments

@odeke-em
Copy link
Collaborator

odeke-em commented Oct 4, 2021

Summary

We need to write benchmarks that use the store package and can help discern performance differences in backends.

Problem Definition

This feature will allow easy and more educated migrations between backends.

Proposal

Go through the usages of store/* and figure out the best benchmarks that use the package, and how to test them effectively test them out. /cc @cuonglm @robert-zaremba for our Thursday meeting discussion.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@odeke-em odeke-em self-assigned this Oct 4, 2021
@odeke-em odeke-em added the T: Performance Performance improvements label Oct 4, 2021
@alexanderbez
Copy link
Contributor

Looking forward to seeing these results!

@robert-zaremba
Copy link
Collaborator

robert-zaremba commented Oct 7, 2021

The idea is to test the CommitKVStore implementation:

  • create test load scenarios with bunch of Has, Get, Set, Delete operations and Commits. Eg: scenario-1: 70% of Set (and bunch of Has, Get, Delete in between). scenario-2: 20% Set and 60% Get....
    • most important scenario: 65% Get, 5% Has and 30% Set
  • Try to "rollback" (load previous version)
  • Try to create a scenario which will crash the DB.
  • analyze the results:
    • what is the most expensive load scenario
    • how commit is impacting the performance

And in the benchmark let's use the tm-db with go-leveldb (the default one) in store/v1 and badger in store/v2, and also rocksdb for both.

Goal: we will run this benchmark on

  1. current store (v1) based on 2-3 backends (most important the go-leveldb which is the default one).
  2. once store v2 will be ready (based on SMT) we will run the benchmark against RocksDB and Bager.

@adu-web3
Copy link
Contributor

adu-web3 commented Dec 7, 2021

Hi @robert-zaremba, I'm working on this right now.
but I don't quite understand why you ask to test load scenarios with different ratio of Has, Get, Set, Delete operations, given Has and Get operations are read-only and will not affect the load performance after commit.
can you explain this more specifically?

@robert-zaremba
Copy link
Collaborator

We want to test store as it's used by msg server. Moreover having different scenarios will let us know more about bottlenecks and performance characteristic.
It's important to do this test on the store level, not SMT. I'm going to update the title of this task.

@robert-zaremba robert-zaremba changed the title store: write benchmarks to facilitate using celestiaorg/smt vs cosmos/iavl store: write benchmarks /store and /store/v2 with different load scenarios Dec 7, 2021
@robert-zaremba robert-zaremba assigned adu-web3 and unassigned odeke-em Dec 7, 2021
@roysc
Copy link
Contributor

roysc commented Mar 4, 2022

I've been running @Muggle-Du 's benchmarks and adapted them to use the DB backend by itself. So far it's clear that the cosmos-sdk/db is responsible for a large part of the performance difference.

  • Rocksdb performance with optimistic transactions is terrible, and is an outlier, even compared to tm-db using the same Rocksdb version.
  • Badgerdb v3 is used in cosmos/db while tm-db uses v2, and there's a small speedup in DB ops, but the store's performance is worse, so we are going to focus on finding out why.

For now I don't see an easy way to improve Rocks and still have transactional semantics, and even without transactions Rocks is also slower than Badger overall, so we'll just stick to Badger for now and look at how to improve the store and algorithms.

@robert-zaremba
Copy link
Collaborator

Thanks @roysc for starting looking at it. I propose to create a new issue where we will analyze the roots of inefficiencies and benchmark improvements.

@roysc
Copy link
Contributor

roysc commented Mar 7, 2022

New issue created at #11328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: Performance Performance improvements
Projects
None yet
6 participants