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

storage: skip merging when no remote storage configured #13427

Merged
merged 1 commit into from Jan 22, 2024

Conversation

bboreham
Copy link
Member

Prometheus is hard-coded to use a fanout storage between TSDB and a remote storage which by default is empty.
This change detects the empty storage and skips merging between result sets, which would make Select() sort results.

Bottom line: we skip a sort unless there really is some remote storage configured.

Prometheus is hard-coded to use a fanout storage between TSDB and
a remote storage which by default is empty.
This change detects the empty storage and skips merging between
result sets, which would make `Select()` sort results.

Bottom line: we skip a sort unless there really is some remote storage
configured.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
@colega
Copy link
Contributor

colega commented Jan 19, 2024

I am not familiar with NewMergeQuerier but shouldn't it do something special if after all filtering len(primaries) == 1 && len(secondaries) == 0? Sounds like it should return primaries[0].

@bboreham
Copy link
Member Author

Currently that optimization is done in Select().

You’re right it could move to the constructor, but I would see that as a separate change.

@bboreham
Copy link
Member Author

/prombench main

@prombot
Copy link
Contributor

prombot commented Jan 19, 2024

⏱️ Welcome to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-13427 and main

After successful deployment, the benchmarking results can be viewed at:

Other Commands:
To stop benchmark: /prombench cancel
To restart benchmark: /prombench restart main

@bboreham
Copy link
Member Author

bboreham commented Jan 19, 2024

Big win: 10% CPU reduction, 30% faster instant queries.

image image
image

(Arguably the benchmark queries are extreme, YMMV)

@bboreham
Copy link
Member Author

/prombench cancel

@prombot
Copy link
Contributor

prombot commented Jan 19, 2024

Benchmark cancel is in progress.

@bboreham bboreham merged commit 0fe7ba9 into prometheus:main Jan 22, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants