@@ -492,6 +492,17 @@ var (
492492 )
493493)
494494
495+ // This setting controls deletion pacing. This helps prevent disk slowness
496+ // events on some SSDs, that kick off an expensive GC if a lot of files are
497+ // deleted at once.
498+ var baselineDeletionRate = settings .RegisterIntSetting (
499+ settings .ApplicationLevel ,
500+ "storage.baseline_deletion_rate" ,
501+ "the baseline allowed rate of bytes deleted per second by each store" ,
502+ 128 * 1024 * 1024 , // 128 MB/s
503+ settings .NonNegativeInt ,
504+ )
505+
495506// EngineComparer is a pebble.Comparer object that implements MVCC-specific
496507// comparator settings for use with Pebble.
497508var EngineComparer = func () pebble.Comparer {
@@ -573,10 +584,6 @@ func DefaultPebbleOptions() *pebble.Options {
573584 // This ensures that range keys are quickly flushed, allowing use of lazy
574585 // combined iteration within Pebble.
575586 opts .FlushDelayRangeKey = 10 * time .Second
576- // Enable deletion pacing. This helps prevent disk slowness events on some
577- // SSDs, that kick off an expensive GC if a lot of files are deleted at
578- // once.
579- opts .TargetByteDeletionRate = 128 << 20 // 128 MB
580587 opts .Experimental .ShortAttributeExtractor = shortAttributeExtractorForValues
581588
582589 opts .Experimental .SpanPolicyFunc = spanPolicyFunc
@@ -927,6 +934,9 @@ func newPebble(ctx context.Context, cfg engineConfig) (p *Pebble, err error) {
927934 return int (concurrentDownloadCompactions .Get (& cfg .settings .SV ))
928935 }
929936 }
937+ cfg .opts .TargetByteDeletionRate = func () int {
938+ return int (baselineDeletionRate .Get (& cfg .settings .SV ))
939+ }
930940
931941 cfg .opts .EnsureDefaults ()
932942
0 commit comments