Skip to content

receive: add deterministic compaction delay interval for multi-tenant TSDB#8658

Open
yuchen-db wants to merge 3 commits intothanos-io:mainfrom
yuchen-db:staggered-compaction
Open

receive: add deterministic compaction delay interval for multi-tenant TSDB#8658
yuchen-db wants to merge 3 commits intothanos-io:mainfrom
yuchen-db:staggered-compaction

Conversation

@yuchen-db
Copy link
Copy Markdown
Contributor

@yuchen-db yuchen-db commented Feb 3, 2026

This PR adds a new --receive.compaction-delay-interval flag to stagger head compaction across tenants deterministically. When set, tenant N gets a delay of N*interval (mod block duration), ensuring compactions are evenly distributed over time. This is useful for deployments with many tenants where the current random delay may still cause compaction clustering and CPU spikes. The default value of 0 preserves the existing random delay behavior.

rolled out in a dev cluster and CPU spikes during compaction is greatly reduced
image

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

… TSDB

Signed-off-by: Yuchen Wang <yuchen.wang@databricks.com>
Signed-off-by: Yuchen Wang <yuchen.wang@databricks.com>
Signed-off-by: Yuchen Wang <yuchen.wang@databricks.com>
@yuchen-db yuchen-db force-pushed the staggered-compaction branch from 78c8bfe to e865679 Compare February 4, 2026 03:49
Copy link
Copy Markdown
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just be the new default or do you see value in setting custom intervals?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants