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

Investigate and document goleveldb configs to identify potential improvements #32

Open
4 tasks
Tracked by #1172
p0mvn opened this issue Feb 27, 2022 · 4 comments
Open
4 tasks
Tracked by #1172
Labels
documentation Improvements or additions to documentation enhancement New feature or request ⚙️ task

Comments

@p0mvn
Copy link
Member

p0mvn commented Feb 27, 2022

Background

We would like to investigate and document all potential improvements from goleveldb configurations and design.

goleveldb settings we use are mainly in:

options for levelDB / the defaults:

ETH’s levelDB: v
-https://github.com/ethereum/go-ethereum/blob/4d086430bd8c0b9549fde5259f74f6df6c96df65/ethdb/leveldb/leveldb.go

Acceptance Criteria

  • Does it make sense to turn off seek compaction?
  • Should we override other defaults in the goleveldb config?
  • Set up goleveldb telemetry and analyze the results
  • Any other potential optimizations?
@p0mvn p0mvn self-assigned this Feb 27, 2022
@p0mvn p0mvn added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 27, 2022
@p0mvn p0mvn changed the title Investigate and document goleveldb settings Investigate and document goleveldb configs to identify potential improvements Feb 27, 2022
@p0mvn p0mvn moved this from 🔍 Needs Review to 🏃 In Progress in Osmosis Chain Development Feb 27, 2022
@p0mvn
Copy link
Member Author

p0mvn commented Feb 27, 2022

Potential Optimization 1

Status: Not pursuing

While looking into go-ethereum, I noticed that they recently implemented a pre-allocated batch buffer.

Apparently, level db is very inefficient when growing the batch buffer at once. It is better to pre-allocate the buffer.

Since we commit a bunch of data at once in SaveVersion , I thought that this would be a good optimization.

However, after creating a relevant PR #29 , I observed that the overhead from pre-calculating batch size outweighs the costs. The results are documented here: #31

@p0mvn
Copy link
Member Author

p0mvn commented Feb 27, 2022

Potential Optimization 2

Status: Not pursuing

In ethereum/go-ethereum#15115, go-ethereum introduces batches that are committed in sizes of 100Kb. According to their benchmarks, this has been proven to be the most optimal for compaction.

To implement this on our side, we would have to significantly redesign IAVL because introducing a similar change would currently break the commit atomicity

@p0mvn
Copy link
Member Author

p0mvn commented Feb 28, 2022

Potential Optimization 3 - Seek compaction

Status: In progress
There are multiple reports that turning off seek compaction improves the compaction process:

We should try implementing something similar and benchmark the results.

@p0mvn
Copy link
Member Author

p0mvn commented Feb 28, 2022

Potential Optimization 4

Status: TBD

To look into this fork and see if we can adopt anything:
https://github.com/line/tm-db/commits/main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request ⚙️ task
Projects
Status: Todo 🕒
Development

No branches or pull requests

2 participants