Skip to content

Commit

Permalink
Merge branch 'pebble-extra-options' into db-conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
magicxyyz committed Apr 24, 2024
2 parents c3c6aff + 69d65fe commit 7e6e2d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cmd/conf/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ type PebbleConfig struct {
L0CompactionThreshold int `koanf:"l0-compaction-threshold"`
L0StopWritesThreshold int `koanf:"l0-stop-writes-threshold"`
LBaseMaxBytes int64 `koanf:"l-base-max-bytes"`
MemTableStopWritesThreshold int `koanf:"mem-table-stop-writes-threshold"`
MaxConcurrentCompactions int `koanf:"max-concurrent-compactions"`
DisableAutomaticCompactions bool `koanf:"disable-automatic-compactions"`
WALBytesPerSync int `koanf:"wal-bytes-per-sync"`
Expand All @@ -131,6 +132,7 @@ var PebbleConfigDefault = PebbleConfig{
L0CompactionThreshold: 0, // pebble default will be used
L0StopWritesThreshold: 0, // pebble default will be used
LBaseMaxBytes: 0, // pebble default will be used
MemTableStopWritesThreshold: 2,
MaxConcurrentCompactions: runtime.NumCPU(),
DisableAutomaticCompactions: false,
WALBytesPerSync: 0, // pebble default will be used
Expand All @@ -150,6 +152,7 @@ func PebbleConfigAddOptions(prefix string, f *flag.FlagSet) {
f.Int(prefix+".l0-compaction-threshold", PebbleConfigDefault.L0CompactionThreshold, "amount of L0 read-amplification necessary to trigger an L0 compaction (0 = pebble default)")
f.Int(prefix+".l0-stop-writes-threshold", PebbleConfigDefault.L0StopWritesThreshold, "hard limit on L0 read-amplification, computed as the number of L0 sublevels. Writes are stopped when this threshold is reached (0 = pebble default)")
f.Int64(prefix+".l-base-max-bytes", PebbleConfigDefault.LBaseMaxBytes, "hard limit on L0 read-amplification, computed as the number of L0 sublevels. Writes are stopped when this threshold is reached (0 = pebble default)")
f.Int(prefix+".mem-table-stop-writes-threshold", PebbleConfigDefault.MemTableStopWritesThreshold, "hard limit on the number of queued of MemTables")
f.Int(prefix+".max-concurrent-compactions", PebbleConfigDefault.MaxConcurrentCompactions, "maximum number of concurrent compactions (0 = pebble default)")
f.Bool(prefix+".disable-automatic-compactions", PebbleConfigDefault.DisableAutomaticCompactions, "disables automatic compactions")
f.Int(prefix+".wal-bytes-per-sync", PebbleConfigDefault.WALBytesPerSync, "number of bytes to write to a write-ahead log (WAL) before calling Sync on it in the backgroud (0 = pebble default)")
Expand Down Expand Up @@ -219,6 +222,7 @@ func (c *PebbleConfig) ExtraOptions() *pebble.ExtraOptions {
L0CompactionThreshold: c.L0CompactionThreshold,
L0StopWritesThreshold: c.L0StopWritesThreshold,
LBaseMaxBytes: c.LBaseMaxBytes,
MemTableStopWritesThreshold: c.MemTableStopWritesThreshold,
MaxConcurrentCompactions: maxConcurrentCompactions,
DisableAutomaticCompactions: c.DisableAutomaticCompactions,
WALBytesPerSync: c.WALBytesPerSync,
Expand Down
2 changes: 1 addition & 1 deletion go-ethereum

0 comments on commit 7e6e2d1

Please sign in to comment.