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(v2): metadata string interning #3744

Merged
merged 6 commits into from
Dec 10, 2024
Merged

Conversation

kolesnikovae
Copy link
Collaborator

@kolesnikovae kolesnikovae commented Dec 6, 2024

The change implements string interning in the metadata model (API) and in the index persistence layer. It introduces an option to store sharable shard-level assets in the index.

This change allows the index snapshot size to decrease by 5-10 times. In an environment with 1-2K services and the default segmentation and compaction parameters, we can now expect approximately 650-800KB of data to be added to the index daily per shard. In a deployment with 128 shards (roughly corresponding to 1GB/s of ingested traffic), the snapshot size will accumulate to 2.5-3GB of data (at rest).

Future work should focus on index snapshot compaction. Currently, the snapshot contains all partitions, including ones that are effectively immutable (due to ingestion window restrictions). We should exploit this fact. This is the reason why I changed the way partitioning is handled and removed the configuration option that controls the partition duration: it will be much more difficult to handle if partition are overlapping. Instead, these should be "immutable" – once created, a partition includes all the entries with corresponding timestamps, regardless of the current partition duration.

In the screenshot, you can see metrics from the dev environment with 12 shards; the deployment is 3 days old:

image

@kolesnikovae kolesnikovae changed the title Feat/metadata string interning feat(v2): metadata string interning Dec 6, 2024
@kolesnikovae kolesnikovae force-pushed the feat/metadata-string-interning branch from d86011c to f9c3f8f Compare December 6, 2024 07:29
@kolesnikovae kolesnikovae marked this pull request as ready for review December 6, 2024 10:54
@kolesnikovae kolesnikovae requested a review from a team as a code owner December 6, 2024 10:54
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.

LGTM

While I have not fully tested this change, I went through all the changes.

I think your assumptions about the immutability of the partition duration is a worth while one. Thanks for refactoring this and this seems to be a great improvement to the snapshotting.

@kolesnikovae kolesnikovae merged commit a5ef3f9 into main Dec 10, 2024
18 checks passed
@kolesnikovae kolesnikovae deleted the feat/metadata-string-interning branch December 10, 2024 10:48
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