From 6407d50250a3f762f41914f3a9dfc69e7ac2e08c Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Thu, 18 Mar 2021 09:52:43 +0100 Subject: [PATCH 1/6] Added benchmark to test v2Push() on errors Signed-off-by: Marco Pracucci --- pkg/ingester/ingester_v2_test.go | 225 ++++++++++++++++++++++--------- 1 file changed, 164 insertions(+), 61 deletions(-) diff --git a/pkg/ingester/ingester_v2_test.go b/pkg/ingester/ingester_v2_test.go index 0ec457ab463..07d551f1e6a 100644 --- a/pkg/ingester/ingester_v2_test.go +++ b/pkg/ingester/ingester_v2_test.go @@ -606,70 +606,170 @@ func TestIngester_v2Push_DecreaseInactiveSeries(t *testing.T) { assert.NoError(t, testutil.GatherAndCompare(registry, strings.NewReader(expectedMetrics), metricNames...)) } -func Benchmark_Ingester_v2PushOnOutOfBoundsSamplesWithHighConcurrency(b *testing.B) { - const ( - numSamplesPerRequest = 1000 - numRequestsPerClient = 10 - numConcurrentClients = 10000 +func Benchmark_Ingester_v2PushOnError(b *testing.B) { + var ( + ctx = user.InjectOrgID(context.Background(), userID) + metricLabelAdapters = []cortexpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} + metricLabels = cortexpb.FromLabelAdaptersToLabels(metricLabelAdapters) + sampleTimestamp = int64(100) + perUserSeriesLimit = 1 ) - registry := prometheus.NewRegistry() - ctx := user.InjectOrgID(context.Background(), userID) + scenarios := map[string]struct { + numSamplesPerRequest int + numConcurrentClients int + }{ + "no concurrency": { + numSamplesPerRequest: 1000, + numConcurrentClients: 1, + }, + "low concurrency": { + numSamplesPerRequest: 1000, + numConcurrentClients: 100, + }, + "high concurrency": { + numSamplesPerRequest: 1000, + numConcurrentClients: 1000, + }, + } - // Create a mocked ingester - cfg := defaultIngesterTestConfig() - cfg.LifecyclerConfig.JoinAfter = 0 + failures := map[string]struct { + beforeBenchmark func(b *testing.B, ingester *Ingester) + runBenchmark func(b *testing.B, ingester *Ingester, metrics []labels.Labels, samples []cortexpb.Sample) + }{ + "out of bound samples": { + beforeBenchmark: func(b *testing.B, ingester *Ingester) { + // Push a single time series to set the TSDB min time. + currTimeReq := cortexpb.ToWriteRequest( + []labels.Labels{metricLabels}, + []cortexpb.Sample{{Value: 1, TimestampMs: util.TimeToMillis(time.Now())}}, + nil, + cortexpb.API) + _, err := ingester.v2Push(ctx, currTimeReq) + require.NoError(b, err) + }, + runBenchmark: func(b *testing.B, ingester *Ingester, metrics []labels.Labels, samples []cortexpb.Sample) { + expectedErr := storage.ErrOutOfBounds.Error() - ingester, err := prepareIngesterWithBlocksStorage(b, cfg, registry) - require.NoError(b, err) - require.NoError(b, services.StartAndAwaitRunning(context.Background(), ingester)) - defer services.StopAndAwaitTerminated(context.Background(), ingester) //nolint:errcheck + // Push out of bound samples. + for n := 0; n < b.N; n++ { + _, err := ingester.v2Push(ctx, cortexpb.ToWriteRequest(metrics, samples, nil, cortexpb.API)) // nolint:errcheck - // Wait until the ingester is ACTIVE - test.Poll(b, 100*time.Millisecond, ring.ACTIVE, func() interface{} { - return ingester.lifecycler.GetState() - }) + if !strings.Contains(err.Error(), expectedErr) { + b.Fatalf("unexpected error. expected: %s actual: %s", expectedErr, err.Error()) + } + } + }, + }, + "out of order samples": { + beforeBenchmark: func(b *testing.B, ingester *Ingester) { + // Push a single sample with a timestamp greater than next pushes. + currTimeReq := cortexpb.ToWriteRequest( + []labels.Labels{metricLabels}, + []cortexpb.Sample{{Value: 1, TimestampMs: sampleTimestamp + 1}}, + nil, + cortexpb.API) + _, err := ingester.v2Push(ctx, currTimeReq) + require.NoError(b, err) + }, + runBenchmark: func(b *testing.B, ingester *Ingester, metrics []labels.Labels, samples []cortexpb.Sample) { + expectedErr := storage.ErrOutOfOrderSample.Error() - // Push a single time series to set the TSDB min time. - metricLabelAdapters := []cortexpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} - metricLabels := cortexpb.FromLabelAdaptersToLabels(metricLabelAdapters) + // Push out of order samples. + for n := 0; n < b.N; n++ { + _, err := ingester.v2Push(ctx, cortexpb.ToWriteRequest(metrics, samples, nil, cortexpb.API)) // nolint:errcheck - currTimeReq := cortexpb.ToWriteRequest( - []labels.Labels{metricLabels}, - []cortexpb.Sample{{Value: 1, TimestampMs: util.TimeToMillis(time.Now())}}, - nil, - cortexpb.API) - _, err = ingester.v2Push(ctx, currTimeReq) - require.NoError(b, err) + if !strings.Contains(err.Error(), expectedErr) { + b.Fatalf("unexpected error. expected: %s actual: %s", expectedErr, err.Error()) + } + } + }, + }, + "per-user series limit reached": { + beforeBenchmark: func(b *testing.B, ingester *Ingester) { + // Push a series with a metric name different than the use used during the benchmark. + metricLabelAdapters := []cortexpb.LabelAdapter{{Name: labels.MetricName, Value: "another"}} + metricLabels := cortexpb.FromLabelAdaptersToLabels(metricLabelAdapters) - // Prepare a request containing out of bound samples. - metrics := make([]labels.Labels, 0, numSamplesPerRequest) - samples := make([]cortexpb.Sample, 0, numSamplesPerRequest) - for i := 0; i < numSamplesPerRequest; i++ { - metrics = append(metrics, metricLabels) - samples = append(samples, cortexpb.Sample{Value: float64(i), TimestampMs: 0}) + currTimeReq := cortexpb.ToWriteRequest( + []labels.Labels{metricLabels}, + []cortexpb.Sample{{Value: 1, TimestampMs: sampleTimestamp + 1}}, + nil, + cortexpb.API) + _, err := ingester.v2Push(ctx, currTimeReq) + require.NoError(b, err) + }, + runBenchmark: func(b *testing.B, ingester *Ingester, metrics []labels.Labels, samples []cortexpb.Sample) { + expectedErr := "per-user series limit" + + // Push series with a different name than the one already pushed. + for n := 0; n < b.N; n++ { + _, err := ingester.v2Push(ctx, cortexpb.ToWriteRequest(metrics, samples, nil, cortexpb.API)) // nolint:errcheck + + if !strings.Contains(err.Error(), expectedErr) { + b.Fatalf("unexpected error. expected: %s actual: %s", expectedErr, err.Error()) + } + } + }, + }, } - outOfBoundReq := cortexpb.ToWriteRequest(metrics, samples, nil, cortexpb.API) - // Run the benchmark. - wg := sync.WaitGroup{} - wg.Add(numConcurrentClients) - start := make(chan struct{}) + for failureName, failure := range failures { + for scenarioName, scenario := range scenarios { + b.Run(fmt.Sprintf("failure: %s, scenario: %s", failureName, scenarioName), func(b *testing.B) { + registry := prometheus.NewRegistry() - for c := 0; c < numConcurrentClients; c++ { - go func() { - defer wg.Done() - <-start + // Create a mocked ingester + cfg := defaultIngesterTestConfig() + cfg.LifecyclerConfig.JoinAfter = 0 - for n := 0; n < numRequestsPerClient; n++ { - ingester.v2Push(ctx, outOfBoundReq) // nolint:errcheck - } - }() - } + limits := defaultLimitsTestConfig() + limits.MaxLocalSeriesPerUser = perUserSeriesLimit - b.ResetTimer() - close(start) - wg.Wait() + ingester, err := prepareIngesterWithBlocksStorageAndLimits(b, cfg, limits, "", registry) + require.NoError(b, err) + require.NoError(b, services.StartAndAwaitRunning(context.Background(), ingester)) + defer services.StopAndAwaitTerminated(context.Background(), ingester) //nolint:errcheck + + // Wait until the ingester is ACTIVE + test.Poll(b, 100*time.Millisecond, ring.ACTIVE, func() interface{} { + return ingester.lifecycler.GetState() + }) + + // Prepare benchmark. + failure.beforeBenchmark(b, ingester) + + // Prepare a request containing out of bound samples. + metrics := make([]labels.Labels, 0, scenario.numSamplesPerRequest) + samples := make([]cortexpb.Sample, 0, scenario.numSamplesPerRequest) + for i := 0; i < scenario.numSamplesPerRequest; i++ { + metrics = append(metrics, metricLabels) + samples = append(samples, cortexpb.Sample{Value: float64(i), TimestampMs: sampleTimestamp}) + } + + // Run the benchmark. + wg := sync.WaitGroup{} + wg.Add(scenario.numConcurrentClients) + start := make(chan struct{}) + + b.ReportAllocs() + b.ResetTimer() + + for c := 0; c < scenario.numConcurrentClients; c++ { + go func() { + defer wg.Done() + <-start + + failure.runBenchmark(b, ingester, metrics, samples) + }() + } + + b.ResetTimer() + close(start) + wg.Wait() + }) + } + } } func Test_Ingester_v2LabelNames(t *testing.T) { @@ -1729,19 +1829,22 @@ func mockWriteRequest(t *testing.T, lbls labels.Labels, value float64, timestamp } func prepareIngesterWithBlocksStorage(t testing.TB, ingesterCfg Config, registerer prometheus.Registerer) (*Ingester, error) { - dataDir, err := ioutil.TempDir("", "ingester") - if err != nil { - return nil, err - } - - t.Cleanup(func() { - require.NoError(t, os.RemoveAll(dataDir)) - }) - - return prepareIngesterWithBlocksStorageAndLimits(t, ingesterCfg, defaultLimitsTestConfig(), dataDir, registerer) + return prepareIngesterWithBlocksStorageAndLimits(t, ingesterCfg, defaultLimitsTestConfig(), "", registerer) } func prepareIngesterWithBlocksStorageAndLimits(t testing.TB, ingesterCfg Config, limits validation.Limits, dataDir string, registerer prometheus.Registerer) (*Ingester, error) { + // Create a data dir if none has been provided. + if dataDir == "" { + var err error + if dataDir, err = ioutil.TempDir("", "ingester"); err != nil { + return nil, err + } + + t.Cleanup(func() { + require.NoError(t, os.RemoveAll(dataDir)) + }) + } + bucketDir, err := ioutil.TempDir("", "bucket") if err != nil { return nil, err From 884033071664a5aa4dbe70dd42491dc4a65b4a67 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Thu, 18 Mar 2021 09:58:31 +0100 Subject: [PATCH 2/6] Optimized metrics tracking in v2Push() on error Signed-off-by: Marco Pracucci --- pkg/ingester/ingester_v2.go | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pkg/ingester/ingester_v2.go b/pkg/ingester/ingester_v2.go index 96b667f510d..051fdf40156 100644 --- a/pkg/ingester/ingester_v2.go +++ b/pkg/ingester/ingester_v2.go @@ -720,9 +720,15 @@ func (i *Ingester) v2Push(ctx context.Context, req *cortexpb.WriteRequest) (*cor // Keep track of some stats which are tracked only if the samples will be // successfully committed - succeededSamplesCount := 0 - failedSamplesCount := 0 - startAppend := time.Now() + var ( + succeededSamplesCount = 0 + failedSamplesCount = 0 + startAppend = time.Now() + sampleOutOfBoundsCount = 0 + sampleOutOfOrderCount = 0 + newValueForTimestampCount = 0 + otherDiscardedReasonsCount = map[string]int{} + ) // Walk the samples, appending them to the users database app := db.Appender(ctx) @@ -783,11 +789,11 @@ func (i *Ingester) v2Push(ctx context.Context, req *cortexpb.WriteRequest) (*cor switch cause { case storage.ErrOutOfBounds: - validation.DiscardedSamples.WithLabelValues(sampleOutOfBounds, userID).Inc() + sampleOutOfBoundsCount++ case storage.ErrOutOfOrderSample: - validation.DiscardedSamples.WithLabelValues(sampleOutOfOrder, userID).Inc() + sampleOutOfOrderCount++ case storage.ErrDuplicateSampleForTimestamp: - validation.DiscardedSamples.WithLabelValues(newValueForTimestamp, userID).Inc() + newValueForTimestampCount++ } continue @@ -799,7 +805,7 @@ func (i *Ingester) v2Push(ctx context.Context, req *cortexpb.WriteRequest) (*cor if firstPartialErr == nil { firstPartialErr = ve } - validation.DiscardedSamples.WithLabelValues(ve.errorType, userID).Inc() + otherDiscardedReasonsCount[ve.errorType]++ continue } @@ -842,6 +848,21 @@ func (i *Ingester) v2Push(ctx context.Context, req *cortexpb.WriteRequest) (*cor i.metrics.ingestedSamples.Add(float64(succeededSamplesCount)) i.metrics.ingestedSamplesFail.Add(float64(failedSamplesCount)) + if sampleOutOfBoundsCount > 0 { + validation.DiscardedSamples.WithLabelValues(sampleOutOfBounds, userID).Add(float64(sampleOutOfBoundsCount)) + } + if sampleOutOfOrderCount > 0 { + validation.DiscardedSamples.WithLabelValues(sampleOutOfOrder, userID).Add(float64(sampleOutOfOrderCount)) + } + if newValueForTimestampCount > 0 { + validation.DiscardedSamples.WithLabelValues(newValueForTimestamp, userID).Add(float64(newValueForTimestampCount)) + } + if len(otherDiscardedReasonsCount) > 0 { + for reason, count := range otherDiscardedReasonsCount { + validation.DiscardedSamples.WithLabelValues(reason, userID).Add(float64(count)) + } + } + switch req.Source { case cortexpb.RULE: db.ingestedRuleSamples.add(int64(succeededSamplesCount)) From 9b73e44259dad8a68f8fb921710a94af49059383 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Thu, 18 Mar 2021 10:20:48 +0100 Subject: [PATCH 3/6] Improved benchmark Signed-off-by: Marco Pracucci --- pkg/ingester/ingester_v2_test.go | 104 +++++++++++++++++++++---------- 1 file changed, 70 insertions(+), 34 deletions(-) diff --git a/pkg/ingester/ingester_v2_test.go b/pkg/ingester/ingester_v2_test.go index 07d551f1e6a..f196ca7b8b7 100644 --- a/pkg/ingester/ingester_v2_test.go +++ b/pkg/ingester/ingester_v2_test.go @@ -608,40 +608,40 @@ func TestIngester_v2Push_DecreaseInactiveSeries(t *testing.T) { func Benchmark_Ingester_v2PushOnError(b *testing.B) { var ( - ctx = user.InjectOrgID(context.Background(), userID) - metricLabelAdapters = []cortexpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} - metricLabels = cortexpb.FromLabelAdaptersToLabels(metricLabelAdapters) - sampleTimestamp = int64(100) - perUserSeriesLimit = 1 + ctx = user.InjectOrgID(context.Background(), userID) + sampleTimestamp = int64(100) + metricName = "test" ) scenarios := map[string]struct { - numSamplesPerRequest int + numSeriesPerRequest int numConcurrentClients int }{ "no concurrency": { - numSamplesPerRequest: 1000, + numSeriesPerRequest: 1000, numConcurrentClients: 1, }, "low concurrency": { - numSamplesPerRequest: 1000, + numSeriesPerRequest: 1000, numConcurrentClients: 100, }, "high concurrency": { - numSamplesPerRequest: 1000, + numSeriesPerRequest: 1000, numConcurrentClients: 1000, }, } - failures := map[string]struct { - beforeBenchmark func(b *testing.B, ingester *Ingester) + tests := map[string]struct { + prepareConfig func(limits *validation.Limits) + beforeBenchmark func(b *testing.B, ingester *Ingester, numSeriesPerRequest int) runBenchmark func(b *testing.B, ingester *Ingester, metrics []labels.Labels, samples []cortexpb.Sample) }{ "out of bound samples": { - beforeBenchmark: func(b *testing.B, ingester *Ingester) { + prepareConfig: func(limits *validation.Limits) {}, + beforeBenchmark: func(b *testing.B, ingester *Ingester, numSeriesPerRequest int) { // Push a single time series to set the TSDB min time. currTimeReq := cortexpb.ToWriteRequest( - []labels.Labels{metricLabels}, + []labels.Labels{{{Name: labels.MetricName, Value: metricName}}}, []cortexpb.Sample{{Value: 1, TimestampMs: util.TimeToMillis(time.Now())}}, nil, cortexpb.API) @@ -662,8 +662,42 @@ func Benchmark_Ingester_v2PushOnError(b *testing.B) { }, }, "out of order samples": { - beforeBenchmark: func(b *testing.B, ingester *Ingester) { - // Push a single sample with a timestamp greater than next pushes. + prepareConfig: func(limits *validation.Limits) {}, + beforeBenchmark: func(b *testing.B, ingester *Ingester, numSeriesPerRequest int) { + // For each series, push a single sample with a timestamp greater than next pushes. + for i := 0; i < numSeriesPerRequest; i++ { + currTimeReq := cortexpb.ToWriteRequest( + []labels.Labels{{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: strconv.Itoa(i)}}}, + []cortexpb.Sample{{Value: 1, TimestampMs: sampleTimestamp + 1}}, + nil, + cortexpb.API) + + _, err := ingester.v2Push(ctx, currTimeReq) + require.NoError(b, err) + } + }, + runBenchmark: func(b *testing.B, ingester *Ingester, metrics []labels.Labels, samples []cortexpb.Sample) { + expectedErr := storage.ErrOutOfOrderSample.Error() + + // Push out of order samples. + for n := 0; n < b.N; n++ { + _, err := ingester.v2Push(ctx, cortexpb.ToWriteRequest(metrics, samples, nil, cortexpb.API)) // nolint:errcheck + + if !strings.Contains(err.Error(), expectedErr) { + b.Fatalf("unexpected error. expected: %s actual: %s", expectedErr, err.Error()) + } + } + }, + }, + "per-user series limit reached": { + prepareConfig: func(limits *validation.Limits) { + limits.MaxLocalSeriesPerUser = 1 + }, + beforeBenchmark: func(b *testing.B, ingester *Ingester, numSeriesPerRequest int) { + // Push a series with a metric name different than the one used during the benchmark. + metricLabelAdapters := []cortexpb.LabelAdapter{{Name: labels.MetricName, Value: "another"}} + metricLabels := cortexpb.FromLabelAdaptersToLabels(metricLabelAdapters) + currTimeReq := cortexpb.ToWriteRequest( []labels.Labels{metricLabels}, []cortexpb.Sample{{Value: 1, TimestampMs: sampleTimestamp + 1}}, @@ -673,9 +707,9 @@ func Benchmark_Ingester_v2PushOnError(b *testing.B) { require.NoError(b, err) }, runBenchmark: func(b *testing.B, ingester *Ingester, metrics []labels.Labels, samples []cortexpb.Sample) { - expectedErr := storage.ErrOutOfOrderSample.Error() + expectedErr := "per-user series limit" - // Push out of order samples. + // Push series with a different name than the one already pushed. for n := 0; n < b.N; n++ { _, err := ingester.v2Push(ctx, cortexpb.ToWriteRequest(metrics, samples, nil, cortexpb.API)) // nolint:errcheck @@ -685,10 +719,13 @@ func Benchmark_Ingester_v2PushOnError(b *testing.B) { } }, }, - "per-user series limit reached": { - beforeBenchmark: func(b *testing.B, ingester *Ingester) { - // Push a series with a metric name different than the use used during the benchmark. - metricLabelAdapters := []cortexpb.LabelAdapter{{Name: labels.MetricName, Value: "another"}} + "per-metric series limit reached": { + prepareConfig: func(limits *validation.Limits) { + limits.MaxLocalSeriesPerMetric = 1 + }, + beforeBenchmark: func(b *testing.B, ingester *Ingester, numSeriesPerRequest int) { + // Push a series with the same metric name but different labels than the one used during the benchmark. + metricLabelAdapters := []cortexpb.LabelAdapter{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: "another"}} metricLabels := cortexpb.FromLabelAdaptersToLabels(metricLabelAdapters) currTimeReq := cortexpb.ToWriteRequest( @@ -700,9 +737,9 @@ func Benchmark_Ingester_v2PushOnError(b *testing.B) { require.NoError(b, err) }, runBenchmark: func(b *testing.B, ingester *Ingester, metrics []labels.Labels, samples []cortexpb.Sample) { - expectedErr := "per-user series limit" + expectedErr := "per-metric series limit" - // Push series with a different name than the one already pushed. + // Push series with different labels than the one already pushed. for n := 0; n < b.N; n++ { _, err := ingester.v2Push(ctx, cortexpb.ToWriteRequest(metrics, samples, nil, cortexpb.API)) // nolint:errcheck @@ -714,9 +751,9 @@ func Benchmark_Ingester_v2PushOnError(b *testing.B) { }, } - for failureName, failure := range failures { + for testName, testData := range tests { for scenarioName, scenario := range scenarios { - b.Run(fmt.Sprintf("failure: %s, scenario: %s", failureName, scenarioName), func(b *testing.B) { + b.Run(fmt.Sprintf("failure: %s, scenario: %s", testName, scenarioName), func(b *testing.B) { registry := prometheus.NewRegistry() // Create a mocked ingester @@ -724,7 +761,7 @@ func Benchmark_Ingester_v2PushOnError(b *testing.B) { cfg.LifecyclerConfig.JoinAfter = 0 limits := defaultLimitsTestConfig() - limits.MaxLocalSeriesPerUser = perUserSeriesLimit + testData.prepareConfig(&limits) ingester, err := prepareIngesterWithBlocksStorageAndLimits(b, cfg, limits, "", registry) require.NoError(b, err) @@ -736,14 +773,13 @@ func Benchmark_Ingester_v2PushOnError(b *testing.B) { return ingester.lifecycler.GetState() }) - // Prepare benchmark. - failure.beforeBenchmark(b, ingester) + testData.beforeBenchmark(b, ingester, scenario.numSeriesPerRequest) - // Prepare a request containing out of bound samples. - metrics := make([]labels.Labels, 0, scenario.numSamplesPerRequest) - samples := make([]cortexpb.Sample, 0, scenario.numSamplesPerRequest) - for i := 0; i < scenario.numSamplesPerRequest; i++ { - metrics = append(metrics, metricLabels) + // Prepare the request. + metrics := make([]labels.Labels, 0, scenario.numSeriesPerRequest) + samples := make([]cortexpb.Sample, 0, scenario.numSeriesPerRequest) + for i := 0; i < scenario.numSeriesPerRequest; i++ { + metrics = append(metrics, labels.Labels{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: strconv.Itoa(i)}}) samples = append(samples, cortexpb.Sample{Value: float64(i), TimestampMs: sampleTimestamp}) } @@ -760,7 +796,7 @@ func Benchmark_Ingester_v2PushOnError(b *testing.B) { defer wg.Done() <-start - failure.runBenchmark(b, ingester, metrics, samples) + testData.runBenchmark(b, ingester, metrics, samples) }() } From d58ed1c7c460f6e78502c97f40f466c4176fd8f0 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Thu, 18 Mar 2021 10:35:33 +0100 Subject: [PATCH 4/6] Added CHANGELOG entry Signed-off-by: Marco Pracucci --- CHANGELOG.md | 1 + after.txt | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ before.txt | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 after.txt create mode 100644 before.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index cc16b0f9c1f..92b73752de9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * `cortex_ruler_clients` * `cortex_ruler_client_request_duration_seconds` * [ENHANCEMENT] Query-frontend/scheduler: added querier forget delay (`-query-frontend.querier-forget-delay` and `-query-scheduler.querier-forget-delay`) to mitigate the blast radius in the event queriers crash because of a repeatedly sent "query of death" when shuffle-sharding is enabled. #3901 +* [ENHANCEMENT] Ingester: reduce CPU and memory when an high number of errors are returned by the ingester on the write path with the blocks storage. #3969 * [BUGFIX] Distributor: reverted changes done to rate limiting in #3825. #3948 * [BUGFIX] Querier: streamline tracing spans. #3924 diff --git a/after.txt b/after.txt new file mode 100644 index 00000000000..5f0dd6ca0f0 --- /dev/null +++ b/after.txt @@ -0,0 +1,78 @@ +goos: darwin +goarch: amd64 +pkg: github.com/cortexproject/cortex/pkg/ingester +Benchmark_Ingester_v2PushOnError +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 4123 289626 ns/op 99036 B/op 2040 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 4076 297061 ns/op 99167 B/op 2040 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 3938 297324 ns/op 99039 B/op 2040 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 4024 303029 ns/op 99099 B/op 2040 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 4026 298274 ns/op 99091 B/op 2040 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 152 7465526 ns/op 10401379 B/op 205751 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 142 7392522 ns/op 10339634 B/op 205538 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 152 7552475 ns/op 10359820 B/op 205641 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 133 9346420 ns/op 10416271 B/op 205771 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 147 8919493 ns/op 10346873 B/op 205559 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 13 90619971 ns/op 152556803 B/op 2223039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 19 76805047 ns/op 127305008 B/op 2135638 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 16 83184048 ns/op 137903682 B/op 2172179 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 19 74868619 ns/op 129982338 B/op 2145171 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 14 77745025 ns/op 159486788 B/op 2244486 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 3957 298239 ns/op 2128 B/op 40 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 4075 295998 ns/op 2131 B/op 40 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 4074 301214 ns/op 2144 B/op 40 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 4063 305400 ns/op 2135 B/op 40 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 4012 297818 ns/op 2154 B/op 40 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 190 6208905 ns/op 259163 B/op 4099 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 180 5933282 ns/op 279742 B/op 4166 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 190 6194147 ns/op 446682 B/op 4752 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 166 7544389 ns/op 446244 B/op 4730 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 169 6989560 ns/op 324709 B/op 4294 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 16 69230800 ns/op 4413005 B/op 40214 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 18 73988154 ns/op 43226210 B/op 175144 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 18 72401109 ns/op 44004021 B/op 178933 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 15 74202558 ns/op 42961058 B/op 174487 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 16 76019187 ns/op 41965213 B/op 170332 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 952 1247938 ns/op 654750 B/op 9034 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 973 1219335 ns/op 654785 B/op 9034 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 933 1209824 ns/op 654994 B/op 9034 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 919 1199948 ns/op 654786 B/op 9034 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 924 1208391 ns/op 655090 B/op 9034 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 39 29613163 ns/op 67505094 B/op 910503 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 39 29298482 ns/op 67448521 B/op 910277 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 37 31761856 ns/op 67580235 B/op 910670 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 36 32418604 ns/op 67669150 B/op 910985 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 34 32372915 ns/op 67789752 B/op 911356 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 361367964 ns/op 830431309 B/op 9613735 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 373402095 ns/op 933048152 B/op 9986449 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 377189010 ns/op 929413394 B/op 9968881 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 4 324385437 ns/op 737915460 B/op 9302773 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 357420469 ns/op 691192925 B/op 9128043 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 787 1434280 ns/op 655471 B/op 9042 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 766 1430241 ns/op 655703 B/op 9042 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 762 1445241 ns/op 655887 B/op 9042 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 771 1457393 ns/op 655669 B/op 9042 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 758 1609665 ns/op 655731 B/op 9042 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 12 93718200 ns/op 71935665 B/op 926061 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 12 97315895 ns/op 67625724 B/op 911028 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 116515870 ns/op 66403499 B/op 906441 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 9 111827336 ns/op 65993382 B/op 905039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 107466280 ns/op 66276611 B/op 906144 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1103578275 ns/op 1476740056 B/op 11780467 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 2 972313634 ns/op 670903840 B/op 9040364 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 2 1047110690 ns/op 674122600 B/op 9047956 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1008011623 ns/op 687142328 B/op 9042264 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1071829428 ns/op 692875464 B/op 9057486 allocs/op +PASS +ok github.com/cortexproject/cortex/pkg/ingester 118.523s diff --git a/before.txt b/before.txt new file mode 100644 index 00000000000..29c5482c21c --- /dev/null +++ b/before.txt @@ -0,0 +1,78 @@ +goos: darwin +goarch: amd64 +pkg: github.com/cortexproject/cortex/pkg/ingester +Benchmark_Ingester_v2PushOnError +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2767 429211 ns/op 131282 B/op 3039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2790 434570 ns/op 131319 B/op 3040 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2371 437541 ns/op 131350 B/op 3040 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2767 436005 ns/op 131326 B/op 3040 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2763 435809 ns/op 131308 B/op 3039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 98 11928860 ns/op 13747080 B/op 306066 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 91 12336824 ns/op 14002626 B/op 306947 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 94 12607437 ns/op 13797148 B/op 306206 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 91 12978589 ns/op 14011369 B/op 306961 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 86 13004559 ns/op 13875535 B/op 306463 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 8 130351838 ns/op 151060719 B/op 3101638 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 7 163939642 ns/op 227875564 B/op 3368545 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 8 134876707 ns/op 173972248 B/op 3181401 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 8 150571220 ns/op 229750358 B/op 3377397 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 9 141534678 ns/op 207065080 B/op 3298332 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2288 484967 ns/op 34402 B/op 1039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2209 463915 ns/op 34375 B/op 1039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2206 459657 ns/op 34441 B/op 1039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2210 461980 ns/op 34436 B/op 1039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2613 461105 ns/op 34382 B/op 1039 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 102 11596602 ns/op 4074680 B/op 105987 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 99 11656584 ns/op 3897323 B/op 105380 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 98 11976614 ns/op 3784173 B/op 104986 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 92 12479429 ns/op 3905784 B/op 105369 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 96 12467053 ns/op 3862149 B/op 105237 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 8 141466710 ns/op 141991852 B/op 1398565 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 9 123499154 ns/op 86542164 B/op 1211272 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 9 131631062 ns/op 96185577 B/op 1243002 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 9 139493507 ns/op 88939936 B/op 1215844 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 8 135724994 ns/op 69038711 B/op 1149689 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 27 39727501 ns/op 71053130 B/op 1011410 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 30 38422126 ns/op 71343968 B/op 1012454 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 30 38910474 ns/op 71054300 B/op 1011367 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 28 39679591 ns/op 71105727 B/op 1011485 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 28 38774051 ns/op 71075556 B/op 1011375 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 391340894 ns/op 867425157 B/op 10630620 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 393770855 ns/op 848712546 B/op 10572696 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 409959649 ns/op 891534922 B/op 10715281 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 367594150 ns/op 699641064 B/op 10051862 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 403144710 ns/op 897566640 B/op 10731216 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 734 1531002 ns/op 687312 B/op 10033 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 739 1389422 ns/op 686981 B/op 10033 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 842 1357719 ns/op 687784 B/op 10033 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 828 1361465 ns/op 686935 B/op 10033 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 834 1356958 ns/op 687350 B/op 10033 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 781 1723446 ns/op 687781 B/op 10041 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 793 1566865 ns/op 687306 B/op 10041 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 778 1441790 ns/op 687895 B/op 10041 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 787 1478663 ns/op 688644 B/op 10042 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 775 1447847 ns/op 688892 B/op 10042 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 106078198 ns/op 75848562 B/op 1028294 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 104818806 ns/op 69310297 B/op 1005430 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 110366535 ns/op 69359276 B/op 1005443 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 103927714 ns/op 72069786 B/op 1015042 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 111274154 ns/op 69255027 B/op 1005133 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1232151179 ns/op 1502987352 B/op 12770207 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1077920042 ns/op 729289040 B/op 10059760 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1163319521 ns/op 1269323480 B/op 11963288 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1087576126 ns/op 728658976 B/op 10065867 allocs/op +Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1181389896 ns/op 1220183912 B/op 11781353 allocs/op +PASS +ok github.com/cortexproject/cortex/pkg/ingester 108.440s From 74b4451f6bbebc8637e9127208b9a3b0b2ed6f12 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Thu, 18 Mar 2021 10:41:27 +0100 Subject: [PATCH 5/6] Removed benchmark results Signed-off-by: Marco Pracucci --- after.txt | 78 ------------------------------------------------------ before.txt | 78 ------------------------------------------------------ 2 files changed, 156 deletions(-) delete mode 100644 after.txt delete mode 100644 before.txt diff --git a/after.txt b/after.txt deleted file mode 100644 index 5f0dd6ca0f0..00000000000 --- a/after.txt +++ /dev/null @@ -1,78 +0,0 @@ -goos: darwin -goarch: amd64 -pkg: github.com/cortexproject/cortex/pkg/ingester -Benchmark_Ingester_v2PushOnError -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 4123 289626 ns/op 99036 B/op 2040 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 4076 297061 ns/op 99167 B/op 2040 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 3938 297324 ns/op 99039 B/op 2040 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 4024 303029 ns/op 99099 B/op 2040 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 4026 298274 ns/op 99091 B/op 2040 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 152 7465526 ns/op 10401379 B/op 205751 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 142 7392522 ns/op 10339634 B/op 205538 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 152 7552475 ns/op 10359820 B/op 205641 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 133 9346420 ns/op 10416271 B/op 205771 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 147 8919493 ns/op 10346873 B/op 205559 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 13 90619971 ns/op 152556803 B/op 2223039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 19 76805047 ns/op 127305008 B/op 2135638 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 16 83184048 ns/op 137903682 B/op 2172179 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 19 74868619 ns/op 129982338 B/op 2145171 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 14 77745025 ns/op 159486788 B/op 2244486 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 3957 298239 ns/op 2128 B/op 40 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 4075 295998 ns/op 2131 B/op 40 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 4074 301214 ns/op 2144 B/op 40 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 4063 305400 ns/op 2135 B/op 40 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 4012 297818 ns/op 2154 B/op 40 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 190 6208905 ns/op 259163 B/op 4099 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 180 5933282 ns/op 279742 B/op 4166 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 190 6194147 ns/op 446682 B/op 4752 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 166 7544389 ns/op 446244 B/op 4730 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 169 6989560 ns/op 324709 B/op 4294 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 16 69230800 ns/op 4413005 B/op 40214 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 18 73988154 ns/op 43226210 B/op 175144 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 18 72401109 ns/op 44004021 B/op 178933 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 15 74202558 ns/op 42961058 B/op 174487 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 16 76019187 ns/op 41965213 B/op 170332 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 952 1247938 ns/op 654750 B/op 9034 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 973 1219335 ns/op 654785 B/op 9034 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 933 1209824 ns/op 654994 B/op 9034 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 919 1199948 ns/op 654786 B/op 9034 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 924 1208391 ns/op 655090 B/op 9034 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 39 29613163 ns/op 67505094 B/op 910503 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 39 29298482 ns/op 67448521 B/op 910277 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 37 31761856 ns/op 67580235 B/op 910670 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 36 32418604 ns/op 67669150 B/op 910985 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 34 32372915 ns/op 67789752 B/op 911356 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 361367964 ns/op 830431309 B/op 9613735 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 373402095 ns/op 933048152 B/op 9986449 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 377189010 ns/op 929413394 B/op 9968881 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 4 324385437 ns/op 737915460 B/op 9302773 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 357420469 ns/op 691192925 B/op 9128043 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 787 1434280 ns/op 655471 B/op 9042 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 766 1430241 ns/op 655703 B/op 9042 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 762 1445241 ns/op 655887 B/op 9042 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 771 1457393 ns/op 655669 B/op 9042 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 758 1609665 ns/op 655731 B/op 9042 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 12 93718200 ns/op 71935665 B/op 926061 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 12 97315895 ns/op 67625724 B/op 911028 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 116515870 ns/op 66403499 B/op 906441 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 9 111827336 ns/op 65993382 B/op 905039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 107466280 ns/op 66276611 B/op 906144 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1103578275 ns/op 1476740056 B/op 11780467 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 2 972313634 ns/op 670903840 B/op 9040364 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 2 1047110690 ns/op 674122600 B/op 9047956 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1008011623 ns/op 687142328 B/op 9042264 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1071829428 ns/op 692875464 B/op 9057486 allocs/op -PASS -ok github.com/cortexproject/cortex/pkg/ingester 118.523s diff --git a/before.txt b/before.txt deleted file mode 100644 index 29c5482c21c..00000000000 --- a/before.txt +++ /dev/null @@ -1,78 +0,0 @@ -goos: darwin -goarch: amd64 -pkg: github.com/cortexproject/cortex/pkg/ingester -Benchmark_Ingester_v2PushOnError -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2767 429211 ns/op 131282 B/op 3039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2790 434570 ns/op 131319 B/op 3040 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2371 437541 ns/op 131350 B/op 3040 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2767 436005 ns/op 131326 B/op 3040 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_no_concurrency-12 2763 435809 ns/op 131308 B/op 3039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 98 11928860 ns/op 13747080 B/op 306066 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 91 12336824 ns/op 14002626 B/op 306947 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 94 12607437 ns/op 13797148 B/op 306206 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 91 12978589 ns/op 14011369 B/op 306961 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_low_concurrency-12 86 13004559 ns/op 13875535 B/op 306463 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 8 130351838 ns/op 151060719 B/op 3101638 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 7 163939642 ns/op 227875564 B/op 3368545 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 8 134876707 ns/op 173972248 B/op 3181401 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 8 150571220 ns/op 229750358 B/op 3377397 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_bound_samples,_scenario:_high_concurrency-12 9 141534678 ns/op 207065080 B/op 3298332 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2288 484967 ns/op 34402 B/op 1039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2209 463915 ns/op 34375 B/op 1039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2206 459657 ns/op 34441 B/op 1039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2210 461980 ns/op 34436 B/op 1039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_no_concurrency-12 2613 461105 ns/op 34382 B/op 1039 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 102 11596602 ns/op 4074680 B/op 105987 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 99 11656584 ns/op 3897323 B/op 105380 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 98 11976614 ns/op 3784173 B/op 104986 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 92 12479429 ns/op 3905784 B/op 105369 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_low_concurrency-12 96 12467053 ns/op 3862149 B/op 105237 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 8 141466710 ns/op 141991852 B/op 1398565 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 9 123499154 ns/op 86542164 B/op 1211272 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 9 131631062 ns/op 96185577 B/op 1243002 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 9 139493507 ns/op 88939936 B/op 1215844 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_out_of_order_samples,_scenario:_high_concurrency-12 8 135724994 ns/op 69038711 B/op 1149689 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 27 39727501 ns/op 71053130 B/op 1011410 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 30 38422126 ns/op 71343968 B/op 1012454 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 30 38910474 ns/op 71054300 B/op 1011367 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 28 39679591 ns/op 71105727 B/op 1011485 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_low_concurrency-12 28 38774051 ns/op 71075556 B/op 1011375 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 391340894 ns/op 867425157 B/op 10630620 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 393770855 ns/op 848712546 B/op 10572696 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 409959649 ns/op 891534922 B/op 10715281 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 367594150 ns/op 699641064 B/op 10051862 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_high_concurrency-12 3 403144710 ns/op 897566640 B/op 10731216 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 734 1531002 ns/op 687312 B/op 10033 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 739 1389422 ns/op 686981 B/op 10033 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 842 1357719 ns/op 687784 B/op 10033 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 828 1361465 ns/op 686935 B/op 10033 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-user_series_limit_reached,_scenario:_no_concurrency-12 834 1356958 ns/op 687350 B/op 10033 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 781 1723446 ns/op 687781 B/op 10041 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 793 1566865 ns/op 687306 B/op 10041 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 778 1441790 ns/op 687895 B/op 10041 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 787 1478663 ns/op 688644 B/op 10042 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_no_concurrency-12 775 1447847 ns/op 688892 B/op 10042 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 106078198 ns/op 75848562 B/op 1028294 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 104818806 ns/op 69310297 B/op 1005430 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 110366535 ns/op 69359276 B/op 1005443 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 103927714 ns/op 72069786 B/op 1015042 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_low_concurrency-12 10 111274154 ns/op 69255027 B/op 1005133 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1232151179 ns/op 1502987352 B/op 12770207 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1077920042 ns/op 729289040 B/op 10059760 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1163319521 ns/op 1269323480 B/op 11963288 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1087576126 ns/op 728658976 B/op 10065867 allocs/op -Benchmark_Ingester_v2PushOnError/failure:_per-metric_series_limit_reached,_scenario:_high_concurrency-12 1 1181389896 ns/op 1220183912 B/op 11781353 allocs/op -PASS -ok github.com/cortexproject/cortex/pkg/ingester 108.440s From 6de2c53ca1b42ae21b491bbe87ce0e7410033b79 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Thu, 18 Mar 2021 10:44:11 +0100 Subject: [PATCH 6/6] Remove if from otherDiscardedReasonsCount Signed-off-by: Marco Pracucci --- pkg/ingester/ingester_v2.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/ingester/ingester_v2.go b/pkg/ingester/ingester_v2.go index 051fdf40156..91d069921cd 100644 --- a/pkg/ingester/ingester_v2.go +++ b/pkg/ingester/ingester_v2.go @@ -857,10 +857,8 @@ func (i *Ingester) v2Push(ctx context.Context, req *cortexpb.WriteRequest) (*cor if newValueForTimestampCount > 0 { validation.DiscardedSamples.WithLabelValues(newValueForTimestamp, userID).Add(float64(newValueForTimestampCount)) } - if len(otherDiscardedReasonsCount) > 0 { - for reason, count := range otherDiscardedReasonsCount { - validation.DiscardedSamples.WithLabelValues(reason, userID).Add(float64(count)) - } + for reason, count := range otherDiscardedReasonsCount { + validation.DiscardedSamples.WithLabelValues(reason, userID).Add(float64(count)) } switch req.Source {