@@ -497,6 +497,17 @@ var (
497497 )
498498)
499499
500+ // This setting controls deletion pacing. This helps prevent disk slowness
501+ // events on some SSDs, that kick off an expensive GC if a lot of files are
502+ // deleted at once.
503+ var baselineDeletionRate = settings .RegisterIntSetting (
504+ settings .ApplicationLevel ,
505+ "storage.baseline_deletion_rate" ,
506+ "the baseline allowed rate of bytes deleted per second by each store" ,
507+ 128 * 1024 * 1024 , // 128 MB/s
508+ settings .NonNegativeInt ,
509+ )
510+
500511// EngineComparer is a pebble.Comparer object that implements MVCC-specific
501512// comparator settings for use with Pebble.
502513var EngineComparer = func () pebble.Comparer {
@@ -578,10 +589,6 @@ func DefaultPebbleOptions() *pebble.Options {
578589 // This ensures that range keys are quickly flushed, allowing use of lazy
579590 // combined iteration within Pebble.
580591 opts .FlushDelayRangeKey = 10 * time .Second
581- // Enable deletion pacing. This helps prevent disk slowness events on some
582- // SSDs, that kick off an expensive GC if a lot of files are deleted at
583- // once.
584- opts .TargetByteDeletionRate = 128 << 20 // 128 MB
585592 opts .Experimental .ShortAttributeExtractor = shortAttributeExtractorForValues
586593
587594 opts .Experimental .SpanPolicyFunc = spanPolicyFunc
@@ -936,6 +943,9 @@ func newPebble(ctx context.Context, cfg engineConfig) (p *Pebble, err error) {
936943 return int (concurrentDownloadCompactions .Get (& cfg .settings .SV ))
937944 }
938945 }
946+ cfg .opts .TargetByteDeletionRate = func () int {
947+ return int (baselineDeletionRate .Get (& cfg .settings .SV ))
948+ }
939949
940950 cfg .opts .EnsureDefaults ()
941951
0 commit comments