Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

receive: randomize TSDB compaction start times #7795

Closed
wants to merge 1 commit into from

Conversation

GiedriusS
Copy link
Member

Don't compact all TSDBs at the same time because that leads to latency spikes. Add initial randomized latency (between 0 and 60 seconds) to spread out the load over time.

@GiedriusS GiedriusS force-pushed the randomize_compaction branch 4 times, most recently from 47cc1ee to edca98c Compare October 10, 2024 07:35
@GiedriusS GiedriusS marked this pull request as ready for review October 10, 2024 08:17
Don't compact all TSDBs at the same time because that leads to latency
spikes. Add initial randomized latency (between 0 and 60 seconds) to
spread out the load over time.

Signed-off-by: Giedrius Statkevičius <[email protected]>
@fpetkovski
Copy link
Contributor

Will this maintain the same block ranges regardless of when we do the compaction? Meaning we won't have blocks that are shifted in time or longer than the configured block size?

@GiedriusS GiedriusS changed the title receive: randomize TSDB compaction times receive: randomize TSDB compaction start times Oct 10, 2024
@GiedriusS
Copy link
Member Author

Yeah, compaction always takes the head's mint and starts from there: https://github.com/prometheus/prometheus/blob/main/tsdb/db.go#L1278-L1279

But while digging into this, I've spotted that a new Prometheus version has a compaction delay option: https://github.com/prometheus/prometheus/blob/main/tsdb/db.go#L89

@GiedriusS
Copy link
Member Author

Closing this in favor of Prometheus dependency bump + enabling that option 😄

@GiedriusS GiedriusS closed this Oct 10, 2024
@GiedriusS GiedriusS deleted the randomize_compaction branch October 10, 2024 09:03
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