diff --git a/docs/blocks-storage/querier.md b/docs/blocks-storage/querier.md index 3b0c998eeb..0d5831ee7d 100644 --- a/docs/blocks-storage/querier.md +++ b/docs/blocks-storage/querier.md @@ -1372,8 +1372,9 @@ blocks_storage: [ship_concurrency: | default = 10] # How frequently does Cortex try to compact TSDB head. Block is only created - # if data covers smallest block range. Must be greater than 0 and max 5 - # minutes. + # if data covers smallest block range. Must be greater than 0 and max 30 + # minutes. Note that up to 50% jitter is added to the value for the first + # compaction to avoid ingesters compacting concurrently. # CLI flag: -blocks-storage.tsdb.head-compaction-interval [head_compaction_interval: | default = 1m] diff --git a/docs/blocks-storage/store-gateway.md b/docs/blocks-storage/store-gateway.md index 9ecd0215d1..bb88559db5 100644 --- a/docs/blocks-storage/store-gateway.md +++ b/docs/blocks-storage/store-gateway.md @@ -1491,8 +1491,9 @@ blocks_storage: [ship_concurrency: | default = 10] # How frequently does Cortex try to compact TSDB head. Block is only created - # if data covers smallest block range. Must be greater than 0 and max 5 - # minutes. + # if data covers smallest block range. Must be greater than 0 and max 30 + # minutes. Note that up to 50% jitter is added to the value for the first + # compaction to avoid ingesters compacting concurrently. # CLI flag: -blocks-storage.tsdb.head-compaction-interval [head_compaction_interval: | default = 1m] diff --git a/docs/configuration/config-file-reference.md b/docs/configuration/config-file-reference.md index 30bbee288c..1ad826306e 100644 --- a/docs/configuration/config-file-reference.md +++ b/docs/configuration/config-file-reference.md @@ -1924,8 +1924,9 @@ tsdb: [ship_concurrency: | default = 10] # How frequently does Cortex try to compact TSDB head. Block is only created - # if data covers smallest block range. Must be greater than 0 and max 5 - # minutes. + # if data covers smallest block range. Must be greater than 0 and max 30 + # minutes. Note that up to 50% jitter is added to the value for the first + # compaction to avoid ingesters compacting concurrently. # CLI flag: -blocks-storage.tsdb.head-compaction-interval [head_compaction_interval: | default = 1m] diff --git a/pkg/storage/tsdb/config.go b/pkg/storage/tsdb/config.go index 81babf7a21..644b855c97 100644 --- a/pkg/storage/tsdb/config.go +++ b/pkg/storage/tsdb/config.go @@ -173,7 +173,7 @@ func (cfg *TSDBConfig) RegisterFlags(f *flag.FlagSet) { f.DurationVar(&cfg.ShipInterval, "blocks-storage.tsdb.ship-interval", 1*time.Minute, "How frequently the TSDB blocks are scanned and new ones are shipped to the storage. 0 means shipping is disabled.") f.IntVar(&cfg.ShipConcurrency, "blocks-storage.tsdb.ship-concurrency", 10, "Maximum number of tenants concurrently shipping blocks to the storage.") f.IntVar(&cfg.MaxTSDBOpeningConcurrencyOnStartup, "blocks-storage.tsdb.max-tsdb-opening-concurrency-on-startup", 10, "limit the number of concurrently opening TSDB's on startup") - f.DurationVar(&cfg.HeadCompactionInterval, "blocks-storage.tsdb.head-compaction-interval", 1*time.Minute, "How frequently does Cortex try to compact TSDB head. Block is only created if data covers smallest block range. Must be greater than 0 and max 30 minutes. Note that up to 50% jitter is added to the value to avoid ingesters compacting concurrently.") + f.DurationVar(&cfg.HeadCompactionInterval, "blocks-storage.tsdb.head-compaction-interval", 1*time.Minute, "How frequently does Cortex try to compact TSDB head. Block is only created if data covers smallest block range. Must be greater than 0 and max 30 minutes. Note that up to 50% jitter is added to the value for the first compaction to avoid ingesters compacting concurrently.") f.IntVar(&cfg.HeadCompactionConcurrency, "blocks-storage.tsdb.head-compaction-concurrency", 5, "Maximum number of tenants concurrently compacting TSDB head into a new block") f.DurationVar(&cfg.HeadCompactionIdleTimeout, "blocks-storage.tsdb.head-compaction-idle-timeout", 1*time.Hour, "If TSDB head is idle for this duration, it is compacted. Note that up to 25% jitter is added to the value to avoid ingesters compacting concurrently. 0 means disabled.") f.IntVar(&cfg.HeadChunksWriteBufferSize, "blocks-storage.tsdb.head-chunks-write-buffer-size-bytes", chunks.DefaultWriteBufferSize, "The write buffer size used by the head chunks mapper. Lower values reduce memory utilisation on clusters with a large number of tenants at the cost of increased disk I/O operations.")