Skip to content

Commit c1fefe0

Browse files
authored
Merge pull request #2388 from CortexFoundation/dev
lower the compaction debt
2 parents 6cd3c1c + 14a6019 commit c1fefe0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

ctxcdb/pebble/pebble.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,17 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
238238
// By setting the WALBytesPerSync, the cached WAL writes will be periodically
239239
// flushed at the background if the accumulated size exceeds this threshold.
240240
WALBytesPerSync: 5 * ctxcdb.IdealBatchSize,
241+
242+
// L0CompactionThreshold specifies the number of L0 read-amplification
243+
// necessary to trigger an L0 compaction. It essentially refers to the
244+
// number of sub-levels at the L0. For each sub-level, it contains several
245+
// L0 files which are non-overlapping with each other, typically produced
246+
// by a single memory-table flush.
247+
//
248+
// The default value in Pebble is 4, which is a bit too large to have
249+
// the compaction debt as around 10GB. By reducing it to 2, the compaction
250+
// debt will be less than 1GB, but with more frequent compactions scheduled.
251+
L0CompactionThreshold: 2,
241252
}
242253
// Disable seek compaction explicitly. Check https://github.com/CortexFoundation/CortexTheseus/pull/20130
243254
// for more details.

0 commit comments

Comments
 (0)