Skip to content

promql: force mmap of head chunks in BenchmarkRangeQuery#12755

Merged
bboreham merged 1 commit intoprometheus:mainfrom
bboreham:rangequery-benchmark-mmap
Aug 26, 2023
Merged

promql: force mmap of head chunks in BenchmarkRangeQuery#12755
bboreham merged 1 commit intoprometheus:mainfrom
bboreham:rangequery-benchmark-mmap

Conversation

@bboreham
Copy link
Member

Otherwise we have a highly unusual situation of over 100 chunks in the headChunks list of each series, which heavily skews performance.

Example before and after:

BenchmarkRangeQuery/expr=a_hundred,steps=1-4                 332           3370400 ns/op           65255 B/op        909 allocs/op
BenchmarkRangeQuery/expr=a_hundred,steps=1-4                1260            868358 ns/op           65835 B/op        909 allocs/op

This was a highly confusing bug to track down, because DB.run() does call mmapHeadChunks every 1 minute, so depending on what benchmarks you run you can get the faster performance.

To avoid Compact() disrupting performance every minute I disabled auto-compacting. However this previously ran after every commit, so I call Compact() once all the data is ready.

Otherwise we have a highly unusual situation of over 100 chunks
in the headChunks list of each series, which heavily skews
performance.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
@bboreham bboreham merged commit c5671c6 into prometheus:main Aug 26, 2023
@bboreham bboreham deleted the rangequery-benchmark-mmap branch August 26, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants