Skip to content

Conversation

f41gh7
Copy link
Contributor

@f41gh7 f41gh7 commented Jun 30, 2025

This commit adds tmp inmemory and data blocks buffers for
index search requests. It allows to reduce memory allocations on block cache misses. Since block cache puts block into cache only on after configured number of cache misses.

Describe Your Changes

Please provide a brief description of the changes you made. Be as specific as possible to help others understand the purpose and impact of your modifications.

Checklist

The following checks are mandatory:

@f41gh7 f41gh7 requested a review from rtm0 June 30, 2025 19:03
@f41gh7
Copy link
Contributor Author

f41gh7 commented Jun 30, 2025

TODO: add benchmark

@f41gh7 f41gh7 force-pushed the mergeset-reduce-gc-pressure branch from 534767c to 7892b18 Compare June 30, 2025 19:20
@f41gh7 f41gh7 force-pushed the mergeset-reduce-gc-pressure branch from 7892b18 to 66202f7 Compare July 1, 2025 12:05
 This commit adds tmp inmemory and data blocks buffers for
index search requests. It allows to reduce memory allocations on block
cache misses. Since block cache puts block into cache only on after
configured number of cache misses.

Signed-off-by: f41gh7 <nik@victoriametrics.com>
@f41gh7 f41gh7 force-pushed the mergeset-reduce-gc-pressure branch from 66202f7 to 4fdc984 Compare July 1, 2025 15:41
@f41gh7 f41gh7 marked this pull request as ready for review July 2, 2025 08:21
Signed-off-by: f41gh7 <nik@victoriametrics.com>
@f41gh7 f41gh7 requested a review from hagen1778 July 17, 2025 18:38
Co-authored-by: Roman Khavronenko <roman@victoriametrics.com>
@f41gh7 f41gh7 requested review from makasim and rtm0 July 17, 2025 18:57
@@ -276,7 +289,9 @@ func (ps *partSearch) nextBHS() error {
return fmt.Errorf("cannot read index block: %w", err)
}
b = idxb
idxbCache.PutBlock(idxbKey, b)
if idxbCache.TryPutBlock(idxbKey, b) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add a comment to explain why we stop referring the block

Comment on lines 42 to 43
tmpIB *inmemoryBlock
tmpIdB *indexBlock
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add a comment explaining how tmp blocks are used

Signed-off-by: f41gh7 <nik@victoriametrics.com>
Co-authored-by: Max Kotliar <mkotlyar@victoriametrics.com>
Copy link
Contributor

@makasim makasim left a comment

Choose a reason for hiding this comment

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

LGTM

@f41gh7 f41gh7 merged commit eb11642 into master Jul 18, 2025
3 checks passed
@f41gh7 f41gh7 deleted the mergeset-reduce-gc-pressure branch July 18, 2025 08:47
f41gh7 added a commit that referenced this pull request Jul 18, 2025
 This commit adds tmp inmemory and data blocks buffers for
index search requests. It allows to reduce memory allocations on block
cache misses. Since block cache puts block into cache only on after
configured number of cache misses.

Related PR #9324
@f41gh7 f41gh7 added the waiting for release The change was merged to upstream, but wasn't released yet. label Jul 18, 2025
@makasim
Copy link
Contributor

makasim commented Jul 22, 2025

The enhancement has been released in v1.122.0

@makasim makasim removed the waiting for release The change was merged to upstream, but wasn't released yet. label Jul 23, 2025
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.

5 participants