Skip to content

Commit 212967d

Browse files
authored
ethdb/pebble: add configuration changes (#33315)
This introduces two main changes to Pebble's configuration: (a) Remove the Bloom filter at Level 6 The Bloom filter is never used at the bottom-most level, so keeping it serves no purpose. Removing it saves storage without affecting read performance. (b) Re-enable read-sampling compaction Read-sampling compaction was previously disabled in the hash-based scheme because all data was identified by hashes and basically no data overwrite. Read sampling compaction makes no sense. After switching to the path-based scheme, data overwrites are much more common, making read-sampling compaction beneficial and reasonable to re-enable.
1 parent be94ea1 commit 212967d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ethdb/pebble/pebble.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
263263
{TargetFileSize: 16 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)},
264264
{TargetFileSize: 32 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)},
265265
{TargetFileSize: 64 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)},
266-
{TargetFileSize: 128 * 1024 * 1024, FilterPolicy: bloom.FilterPolicy(10)},
266+
267+
// Pebble doesn't use the Bloom filter at level6 for read efficiency.
268+
{TargetFileSize: 128 * 1024 * 1024},
267269
},
268270
ReadOnly: readonly,
269271
EventListener: &pebble.EventListener{
@@ -294,10 +296,6 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
294296
// debt will be less than 1GB, but with more frequent compactions scheduled.
295297
L0CompactionThreshold: 2,
296298
}
297-
// Disable seek compaction explicitly. Check https://github.com/ethereum/go-ethereum/pull/20130
298-
// for more details.
299-
opt.Experimental.ReadSamplingMultiplier = -1
300-
301299
// Open the db and recover any potential corruptions
302300
innerDB, err := pebble.Open(file, opt)
303301
if err != nil {

0 commit comments

Comments
 (0)