-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
ethdb/pebble: add database backend using pebble #24615
Conversation
Charts from a snap sync (LevelDB is orange, Pebble is green): Pebble disk usage:
Leveldb disk usage:
|
8df05d4
to
f9d8001
Compare
ethdb/leveldb/leveldb.go
Outdated
if matches, err := filepath.Glob(file + "/OPTIONS*"); len(matches) > 0 || err != nil { | ||
if err != nil { | ||
panic(err) // only possible if the pattern is malformed |
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.
pebble fingerprinting should be in pebble/pebble.go
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 removed the db detection code from both leveldb.go
/pebble.go
and moved it into core/raw/database.go
.
2393fd3
to
ef8979b
Compare
Update: still waiting for upstream on cockroachdb/pebble#1628 |
Actually they have responded cockroachdb/pebble#1628 (review) . |
@jwasinger would you mind rebasing this? |
@holiman done. |
// Per-level options. Options for at least one level must be specified. The | ||
// options for the last level are used for all subsequent levels. | ||
Levels: []pebble.LevelOptions{ | ||
{TargetFileSize: 2 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)}, |
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.
Did we every try with any larger files in pebble?
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 didn't. Maybe @rjl493456442 did at some point?
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.
Yes, I did. As far as I remember it's the same as with LevelDB, compaction makes it go boom.
Testing this on two bootnodes which have a very hard time syncing
and for comparison:
|
Metrics that do not appear to work: Edi - here's why the disk read meter is always zerot: if db.diskReadMeter != nil {
db.diskReadMeter.Mark(0) // pebble doesn't track non-compaction reads
} Is there any point in even having the metric around? Though I suppose we can keep it for a while, to stay in par with leveldb. |
The pebble azure nodes are on ~26%
The non-pebble are on ~15%
|
Pebble-nodes finished the first phase a couple of hours earlier
Leveldb-nodes:
|
RIght, there's this too:
Which afaict would be fixed by cockroachdb/pebble#1619. It has been open since april. |
Found a little issue : => geth[2101456]: Fatal: Failed to register the Ethereum service: MemTableSize (21 G) must be < 4.0 G So, MemTableSize should be capped to 4GB max 65536 => 32768 => from https://github.com/cockroachdb/pebble/blob/master/options.go |
@SLoeuillet thanks for the feedback and charts! |
Ah, the max memtable size is not so much becaues the field is an
|
Co-authored-by: Gary Rong <garyrong0905@gmail.com> foo update
node: fix ddir lookup mistake accounts/abi/bind: fix go.mod replacement for generated binding deps: update pebble + with fix 32-bit build
With a great pleasure, I can announce that my archive node running leveldb standard storage, did just finish to sync to HEAD Pebble 1.11.0 based one, started sync on 2022-09-16, currently at 7925855 blocks. |
I ran a successful snap sync with it again. Took a pretty long time on a very underprovisioned node (5.8GB usable RAM) but it finished after ~70 hours |
Triage discussion: I'll take this PR and try to separate the 64-bit and 32-bit, and make it so that we avoid pebble when building 32-bit. |
Closing in favour of #26517 |
Uses Pebble patched to expose an API for getting the amount of heap memory allocated through CGo: https://github.com/jwasinger/pebble/tree/mem-stats .
Modifies the
system/memory/used
andsystem/memory/held
gauges to include Pebble's allocation through CGo.