Skip to content

Commit

Permalink
receive: Expose write chunk queue as flag (#5566)
Browse files Browse the repository at this point in the history
* receive: Expose write chunk queue as flag

Signed-off-by: Philip Gough <[email protected]>

* docs: Update changelog

Signed-off-by: Philip Gough <[email protected]>
  • Loading branch information
philipgough authored Aug 8, 2022
1 parent ca32b23 commit 291b6fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 15 additions & 8 deletions cmd/thanos/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -787,6 +788,7 @@ type receiveConfig struct {
tsdbMaxBlockDuration *model.Duration
tsdbAllowOverlappingBlocks bool
tsdbMaxExemplars int64
tsdbWriteQueueSize int64

walCompression bool
noLockFile bool
Expand Down Expand Up @@ -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", "")

Expand Down

0 comments on commit 291b6fa

Please sign in to comment.