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

Pebble DB Integration into DB Bench Tool #155

Merged

Conversation

praetoriansentry
Copy link
Member

@praetoriansentry praetoriansentry commented Nov 9, 2023

Description

Geth has support for pebble db and it seems like bor will soon. This PR adds a mode flag to polycli to support testing a pebble db storage engine in addition to leveldb.

Testing

# Create a baseline from leveldb testing
go run main.go dbbench --degree-of-parallelism 2 | jq '.' > result-level.json
# Move the database somewhere
mv _benchmark_db/ _benchmark_db.bak
# Run the same test but in pebble db mode
go run main.go dbbench --degree-of-parallelism 2 --db-mode pebbledb | jq '.' > result-pebble.json

Generally, it seems like pebble db is faster in all of the categories except for random reads.
image

It does seem like there might be a pretty big difference in final state size
image

@praetoriansentry praetoriansentry marked this pull request as ready for review November 9, 2023 16:11
Comment on lines +529 to +530
// It's not entirely obvious WHY this is needed, but without it, there are issues with the way that
// pebble db manages it's iterators and internal state. Level db works fine though.
Copy link
Member Author

Choose a reason for hiding this comment

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

@nivida fyi lol

wo *opt.WriteOptions
handle *leveldb.DB
}
PebbleDBWrapper struct {
Copy link
Member

@leovct leovct Nov 10, 2023

Choose a reason for hiding this comment

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

nit: I would move most of the logic related to:

  • PebbleDB in pebbledb.go.
  • LevelDB in leveldb.go.
  • KeyValueDB and RandomKeySeeker in db_interface.go or something like this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can move the pebbledb and leveldb implementations. I think that the common interferface between the two makes sense in the main package with the command. RandomKeySeeker, I have no point of view, it's just a utility class that I needed for now I'll probably leave it where it is

@@ -2,7 +2,7 @@ This command is meant to give us a sense of the system level
performance for leveldb:

```bash
go run main.go leveldbbench --degree-of-parallelism 2 | jq '.' > result.json
go run main.go dbbench --degree-of-parallelism 2 | jq '.' > result.json
Copy link
Member

@leovct leovct Nov 10, 2023

Choose a reason for hiding this comment

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

nit: replace go run main.go with polycli

@@ -2,7 +2,7 @@ This command is meant to give us a sense of the system level
performance for leveldb:

```bash
go run main.go leveldbbench --degree-of-parallelism 2 | jq '.' > result.json
go run main.go dbbench --degree-of-parallelism 2 | jq '.' > result.json
```

In many cases, we'll want to emulate the performance characteristics
Copy link
Member

Choose a reason for hiding this comment

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

unrelated to the PR, but curious to know how you get these values

Copy link
Member

@leovct leovct left a comment

Choose a reason for hiding this comment

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

lgtm! 👏

@praetoriansentry praetoriansentry merged commit 2b5567b into main Nov 10, 2023
6 checks passed
@praetoriansentry praetoriansentry deleted the DVT-1086-include-pebble-db-in-leveldbbench-tool branch November 10, 2023 12:39
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.

2 participants