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

Enable active series metrics in the ingester by default #4257

Merged
merged 3 commits into from
Jun 8, 2021
Merged

Enable active series metrics in the ingester by default #4257

merged 3 commits into from
Jun 8, 2021

Conversation

56quarters
Copy link
Contributor

Signed-off-by: Nick Pillitteri [email protected]

What this PR does:

This change calculates and exports the cortex_ingester_active_series
metric by default. Up to this point, the metric was disabled by default since
calculating it consumes some amount of memory.

The original PR (#3153) estimated for 1M active series at least 40MB
and up to another 200MB depending on our luck reusing labels from the
ref cache.

We (Grafana) have been running with this setting enabled on our ingesters
for some time and the resource usage doesn't appear to be significant.
This feature appears to add between 1.2 - 1.6% in memory usage when
enabled: ~140MB out of a total of ~10GB of memory used per ingester.

The ingesters I measured this on

  • Have multiple tenants running production workloads
  • Have about 1.3M active series each
  • Have about a 10GB working set (as measured by kubectl top and exported
    k8s metrics)

Based on this and the utility of the metric itself, I'd like to enable it
by default.

Screenshots of the pprof heap output attached.

table
graph

Checklist
- [ ] Tests updated

  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

This change calculates and exports the `cortex_ingester_active_series`
by default. Up to this point, the metric was disabled by default since
calculating it consumes some amount of memory.

The original PR (#3153) estimated for 1M active series at least 40MB
and up to another 200MB depending on our luck reusing labels from the
ref cache.

We (Grafana) have been running with this setting enabled on our ingesters
for some time and the resource usage doesn't appear to be significant.
This feature appears to add between 1.2 - 1.6% in memory usage when
enabled: ~140MB out of a total of ~10GB of memory used per ingester.

The ingesters I measured this on

* Have multiple tenants running production workloads
* Have about 1.3M active series each
* Have about a 10GB working set (as measured by `kubectl top` and exported
  k8s metrics)

Based on this and the utility of the metric itself, I'd like to enable it
by default.

Screenshots of the pprof heap output attached.

Signed-off-by: Nick Pillitteri <[email protected]>
Signed-off-by: Nick Pillitteri <[email protected]>
@56quarters 56quarters changed the title WIP: Enable active series metrics in the ingester by default Enable active series metrics in the ingester by default Jun 3, 2021
@56quarters 56quarters marked this pull request as ready for review June 3, 2021 18:27
Copy link
Contributor

@stevesg stevesg left a comment

Choose a reason for hiding this comment

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

Appreciate the detailed analysis. Thanks!

One optional nit.

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Signed-off-by: Nick Pillitteri <[email protected]>
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

LGTM, thank you.

Up to this point, the metric was disabled by default since calculating it consumes some amount of memory.

That's not the only reason. Main reason is that everybody does a calculation of active series differently.

This feature was introduced because after switch from chunks to blocks engine, "in memory series" started to be computed differently. To make it more configurable and compatible with computation in chunks storage, we have introduced "active series" metrics.

@pstibrany pstibrany merged commit 1a5687f into cortexproject:master Jun 8, 2021
@56quarters 56quarters deleted the expose-active-series-by-default branch June 8, 2021 13:13
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.

4 participants