Skip to content

Commit

Permalink
storage: use jemalloc size classes when intializing pebble
Browse files Browse the repository at this point in the history
This patch makes use of the pebble size class aware flush heuristics
introduced in cockroachdb/pebble#3508. The
experimentation there showed improvements in internal fragmentation.

Fixes cockroachdb#123090.

Release note: None
  • Loading branch information
aadityasondhi committed Jun 13, 2024
1 parent c4a0d99 commit fa3b057
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/storage/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,18 @@ func DefaultPebbleOptions() *pebble.Options {
l.EnsureDefaults()
}

// These size classes are a subset of available size classes in jemalloc[1].
// The size classes are used by Pebble for determining target block sizes for
// flushes, with the goal of reducing internal fragmentation.
//
// [1] https://jemalloc.net/jemalloc.3.html#size_classes
opts.AllocatorSizeClasses = []int{
16384,
20480, 24576, 28672, 32768,
40960, 49152, 57344, 65536,
81920, 98304, 114688, 131072,
}

return opts
}

Expand Down

0 comments on commit fa3b057

Please sign in to comment.