diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc2b98ccf..9cf6fd1952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#5527](https://github.com/thanos-io/thanos/pull/5527) Receive: Add per request limits for remote write. - [#5520](https://github.com/thanos-io/thanos/pull/5520) Receive: Meta-monitoring based active series limiting - [#5555](https://github.com/thanos-io/thanos/pull/5555) Query: Added `--query.active-query-path` flag, allowing the user to configure the directory to create an active query tracking file, `queries.active`, for different resolution. +- [#5566](https://github.com/thanos-io/thanos/pull/5566) Receive: Added experimental support to enable chunk write queue via `--tsdb.write-queue-size` flag. ### Changed diff --git a/cmd/thanos/receive.go b/cmd/thanos/receive.go index a8a5ddeb39..dd259fed3e 100644 --- a/cmd/thanos/receive.go +++ b/cmd/thanos/receive.go @@ -73,14 +73,15 @@ func registerReceive(app *extkingpin.App) { } tsdbOpts := &tsdb.Options{ - MinBlockDuration: int64(time.Duration(*conf.tsdbMinBlockDuration) / time.Millisecond), - MaxBlockDuration: int64(time.Duration(*conf.tsdbMaxBlockDuration) / time.Millisecond), - RetentionDuration: int64(time.Duration(*conf.retention) / time.Millisecond), - NoLockfile: conf.noLockFile, - WALCompression: conf.walCompression, - AllowOverlappingBlocks: conf.tsdbAllowOverlappingBlocks, - MaxExemplars: conf.tsdbMaxExemplars, - EnableExemplarStorage: true, + MinBlockDuration: int64(time.Duration(*conf.tsdbMinBlockDuration) / time.Millisecond), + MaxBlockDuration: int64(time.Duration(*conf.tsdbMaxBlockDuration) / time.Millisecond), + RetentionDuration: int64(time.Duration(*conf.retention) / time.Millisecond), + NoLockfile: conf.noLockFile, + WALCompression: conf.walCompression, + AllowOverlappingBlocks: conf.tsdbAllowOverlappingBlocks, + MaxExemplars: conf.tsdbMaxExemplars, + EnableExemplarStorage: true, + HeadChunksWriteQueueSize: int(conf.tsdbWriteQueueSize), } // Are we running in IngestorOnly, RouterOnly or RouterIngestor mode? @@ -787,6 +788,7 @@ type receiveConfig struct { tsdbMaxBlockDuration *model.Duration tsdbAllowOverlappingBlocks bool tsdbMaxExemplars int64 + tsdbWriteQueueSize int64 walCompression bool noLockFile bool @@ -889,6 +891,11 @@ func (rc *receiveConfig) registerFlag(cmd extkingpin.FlagClause) { " ingesting a new exemplar will evict the oldest exemplar from storage. 0 (or less) value of this flag disables exemplars storage."). Default("0").Int64Var(&rc.tsdbMaxExemplars) + cmd.Flag("tsdb.write-queue-size", + "[EXPERIMENTAL] Enables configuring the size of the chunk write queue used in the head chunks mapper. "+ + "A queue size of zero (default) disables this feature entirely."). + Default("0").Hidden().Int64Var(&rc.tsdbWriteQueueSize) + cmd.Flag("hash-func", "Specify which hash function to use when calculating the hashes of produced files. If no function has been specified, it does not happen. This permits avoiding downloading some files twice albeit at some performance cost. Possible values are: \"\", \"SHA256\"."). Default("").EnumVar(&rc.hashFunc, "SHA256", "")