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: Scalable Compactor #2466

Merged
merged 94 commits into from
Oct 19, 2023
Merged

feat: Scalable Compactor #2466

merged 94 commits into from
Oct 19, 2023

Conversation

cyriltovena
Copy link
Contributor

@cyriltovena cyriltovena commented Sep 29, 2023

This PR introduces a scalable compactor component that can split and merge Pyroscope blocks to improve performance and deduplicate replication factor.

This is heavily inspired by Mimir compactor but adapted for Pyroscope. One of the main difference for instance is that Pyroscope maxT are inclusive.

The design and behaviour is documented here https://grafana.com/docs/mimir/latest/references/architecture/components/compactor/

Splitting is optional and only required for large tenants where output blocks would be too big.

Remaining tasks:

  • Add the compactor component (right now only the package is there)
  • Update the store-gateway to only download compacted blocks and use the block index file.
  • Tweak the configuration to fit Pyroscope needs (specially the first range is 2h where our blocks is 3h by default)
  • Test in a real environment and iterate on it.
    • Test vertical compaction
    • Test split and merge compaction
  • Document operations [DOC] Document the Compactor #2540

Previous related PR:

Testing Result

See how block were before level 1 not aligned, now you can see the 8h range being compacted.
image

cyriltovena and others added 30 commits September 6, 2023 10:26
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.

I have not made it through every line of this PR, but I was able to get it running on a local cluster.

pkg/phlaredb/compact.go Show resolved Hide resolved
cmd/pyroscope/help-all.txt.tmpl Outdated Show resolved Hide resolved
cmd/pyroscope/help-all.txt.tmpl Outdated Show resolved Hide resolved
cmd/pyroscope/help-all.txt.tmpl Show resolved Hide resolved
cmd/pyroscope/help-all.txt.tmpl Outdated Show resolved Hide resolved
cmd/pyroscope/help-all.txt.tmpl Outdated Show resolved Hide resolved
pkg/compactor/compactor.go Show resolved Hide resolved
cmd/pyroscope/help-all.txt.tmpl Show resolved Hide resolved
pkg/phlaredb/compact.go Show resolved Hide resolved
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.

Thanks for looking at my comments and addressing them (when they were valid 😆) and obviously bringing compaction 🚀

LGTM

@cyriltovena cyriltovena merged commit 728493e into main Oct 19, 2023
16 checks passed
@cyriltovena cyriltovena deleted the feat/compactor-component branch October 19, 2023 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Mostly go code object-storage ops Features that help pyroscope operators performance If there's anything we have to be really good at it's this storage Low level storage matters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants