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

feat: compactor rewriter LRU cache #3165

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

kolesnikovae
Copy link
Collaborator

@kolesnikovae kolesnikovae commented Apr 5, 2024

The PR changes the way symbolic data is managed at compaction. Instead of loading all partitions simultaneously, only the last two partitions will be retained. In the vast majority of cases, a partition will be accessed only once, as it is utilized by a continuous range of profiles.

Experiments indicate that this approach reduces memory usage by at least 20%:
image

Increased CPU consumption does not cause major issues:
image

LRU cache with a fixed size of 2 is used to limit the number of partitions loaded simultaneously. Subsequently, if deemed necessary, we can make this parameter configurable.

Partially mitigates #3127

@kolesnikovae kolesnikovae force-pushed the feat/compactor-rewriter-partition-lru branch from 6078947 to 6159263 Compare April 5, 2024 08:04
@kolesnikovae kolesnikovae marked this pull request as ready for review April 5, 2024 09:05
@kolesnikovae kolesnikovae requested a review from a team as a code owner April 5, 2024 09:05
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

Good work! I do think we can afford the CPU on those nodes, as they are so memory heavy there is barely good CPU utilization possible.

LGTM

@kolesnikovae kolesnikovae merged commit f63de9b into main Apr 8, 2024
16 checks passed
@kolesnikovae kolesnikovae deleted the feat/compactor-rewriter-partition-lru branch April 8, 2024 02:07
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