mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-06 23:18:37 +00:00
ethdb/pebble: lower the compaction debt (#31988)
This pull request reduces the threshold for triggering compaction at level0, leading to less compaction debt. This change is helpful in the case of heavy write-load, mitigating the case of heavy write stalls caused by compaction. closes https://github.com/ethereum/go-ethereum/issues/31830
This commit is contained in:
parent
05e199408f
commit
71653cf0c2
1 changed files with 11 additions and 0 deletions
|
|
@ -280,6 +280,17 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
|
||||||
// By setting the WALBytesPerSync, the cached WAL writes will be periodically
|
// By setting the WALBytesPerSync, the cached WAL writes will be periodically
|
||||||
// flushed at the background if the accumulated size exceeds this threshold.
|
// flushed at the background if the accumulated size exceeds this threshold.
|
||||||
WALBytesPerSync: 5 * ethdb.IdealBatchSize,
|
WALBytesPerSync: 5 * ethdb.IdealBatchSize,
|
||||||
|
|
||||||
|
// L0CompactionThreshold specifies the number of L0 read-amplification
|
||||||
|
// necessary to trigger an L0 compaction. It essentially refers to the
|
||||||
|
// number of sub-levels at the L0. For each sub-level, it contains several
|
||||||
|
// L0 files which are non-overlapping with each other, typically produced
|
||||||
|
// by a single memory-table flush.
|
||||||
|
//
|
||||||
|
// The default value in Pebble is 4, which is a bit too large to have
|
||||||
|
// the compaction debt as around 10GB. By reducing it to 2, the compaction
|
||||||
|
// debt will be less than 1GB, but with more frequent compactions scheduled.
|
||||||
|
L0CompactionThreshold: 2,
|
||||||
}
|
}
|
||||||
// Disable seek compaction explicitly. Check https://github.com/ethereum/go-ethereum/pull/20130
|
// Disable seek compaction explicitly. Check https://github.com/ethereum/go-ethereum/pull/20130
|
||||||
// for more details.
|
// for more details.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue