-
Notifications
You must be signed in to change notification settings - Fork 1.4k
lib/mergeset: reduce memory allocations on blockcache misses #9324
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
Conversation
TODO: add benchmark |
534767c
to
7892b18
Compare
7892b18
to
66202f7
Compare
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>
66202f7
to
4fdc984
Compare
Signed-off-by: f41gh7 <nik@victoriametrics.com>
Co-authored-by: Roman Khavronenko <roman@victoriametrics.com>
@@ -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) { |
There was a problem hiding this comment.
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
lib/mergeset/part_search.go
Outdated
tmpIB *inmemoryBlock | ||
tmpIdB *indexBlock |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
The enhancement has been released in v1.122.0 |
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: