Skip to content

Commit

Permalink
Standardize ingestion burst setting (#445)
Browse files Browse the repository at this point in the history
* Rename IngestionMaxBatchSize setting to IngestionBurstSize and update defaults

* Update changelog
  • Loading branch information
mdisibio committed Jan 8, 2021
1 parent d995676 commit a796195
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [CHANGE] Compactors should round robin tenants instead of choosing randomly [#420](https://github.com/grafana/tempo/issues/420)
* [CHANGE] Switch distributor->ingester communication to more efficient PushBytes method. This is a **breaking change** when running in microservices mode with separate distributors and ingesters. To prevent errors ingesters must be fully upgraded first, then distributors.
* [CHANGE] Removed disk_cache. This is a **breaking change** b/c there is no disk cache. Please use redis or memcached. [#441](https://github.com/grafana/tempo/pull/441)
* [CHANGE] Rename IngestionMaxBatchSize to IngestionBurstSize. This is a **breaking change**. [#445](https://github.com/grafana/tempo/pull/445)
* [ENHANCEMENT] Add docker-compose example for GCS along with new backend options [#397](https://github.com/grafana/tempo/pull/397)
* [ENHANCEMENT] tempo-cli list blocks usability improvements [#403](https://github.com/grafana/tempo/pull/403)
* [ENHANCEMENT] Add Query Frontend module to allow scaling the query path [#400](https://github.com/grafana/tempo/pull/400)
Expand Down
2 changes: 1 addition & 1 deletion integration/microservices/tempo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ memberlist:
- ingester-1:7946

overrides:
ingestion_max_batch_size: 100000
ingestion_burst_size: 100000
max_traces_per_user: 1000000

server:
Expand Down
4 changes: 2 additions & 2 deletions modules/distributor/ingestion_rate_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (s *localStrategy) Limit(userID string) float64 {
}

func (s *localStrategy) Burst(userID string) int {
return s.limits.IngestionMaxBatchSize(userID)
return s.limits.IngestionBurstSize(userID)
}

type globalStrategy struct {
Expand Down Expand Up @@ -53,5 +53,5 @@ func (s *globalStrategy) Limit(userID string) float64 {
func (s *globalStrategy) Burst(userID string) int {
// The meaning of burst doesn't change for the global strategy, in order
// to keep it easier to understand for users / operators.
return s.limits.IngestionMaxBatchSize(userID)
return s.limits.IngestionBurstSize(userID)
}
4 changes: 2 additions & 2 deletions modules/distributor/ingestion_rate_strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestIngestionRateStrategy(t *testing.T) {
limits: overrides.Limits{
IngestionRateStrategy: validation.LocalIngestionRateStrategy,
IngestionRateSpans: 5,
IngestionMaxBatchSize: 2,
IngestionBurstSize: 2,
},
ring: nil,
expectedLimit: 5,
Expand All @@ -32,7 +32,7 @@ func TestIngestionRateStrategy(t *testing.T) {
limits: overrides.Limits{
IngestionRateStrategy: validation.GlobalIngestionRateStrategy,
IngestionRateSpans: 5,
IngestionMaxBatchSize: 2,
IngestionBurstSize: 2,
},
ring: func() ReadLifecycler {
ring := newReadLifecyclerMock()
Expand Down
4 changes: 2 additions & 2 deletions modules/overrides/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Limits struct {
// Distributor enforced limits.
IngestionRateStrategy string `yaml:"ingestion_rate_strategy"`
IngestionRateSpans int `yaml:"ingestion_rate_limit"`
IngestionMaxBatchSize int `yaml:"ingestion_max_batch_size"`
IngestionBurstSize int `yaml:"ingestion_burst_size"`

// Ingester enforced limits.
MaxLocalTracesPerUser int `yaml:"max_traces_per_user"`
Expand All @@ -36,7 +36,7 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) {
// Distributor Limits
f.StringVar(&l.IngestionRateStrategy, "distributor.rate-limit-strategy", "local", "Whether the various ingestion rate limits should be applied individually to each distributor instance (local), or evenly shared across the cluster (global).")
f.IntVar(&l.IngestionRateSpans, "distributor.ingestion-rate-limit", 100000, "Per-user ingestion rate limit in spans per second.")
f.IntVar(&l.IngestionMaxBatchSize, "distributor.ingestion-max-batch-size", 1000, "Per-user allowed ingestion max batch size (in number of spans).")
f.IntVar(&l.IngestionBurstSize, "distributor.ingestion-burst-size", 150000, "Per-user ingestion burst size in spans. Should be set to at least the number of spans expected in a single push request.")

// Ingester limits
f.IntVar(&l.MaxLocalTracesPerUser, "ingester.max-traces-per-user", 10e3, "Maximum number of active traces per user, per ingester. 0 to disable.")
Expand Down
6 changes: 3 additions & 3 deletions modules/overrides/overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ func (o *Overrides) IngestionRateSpans(userID string) float64 {
return float64(o.getOverridesForUser(userID).IngestionRateSpans)
}

// IngestionMaxBatchSize is the burst size in spans allowed for this tenant
func (o *Overrides) IngestionMaxBatchSize(userID string) int {
return o.getOverridesForUser(userID).IngestionMaxBatchSize
// IngestionBurstSize is the burst size in spans allowed for this tenant
func (o *Overrides) IngestionBurstSize(userID string) int {
return o.getOverridesForUser(userID).IngestionBurstSize
}

func (o *Overrides) getOverridesForUser(userID string) *Limits {
Expand Down
8 changes: 4 additions & 4 deletions modules/overrides/overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestOverrides(t *testing.T) {
MaxGlobalTracesPerUser: 1,
MaxLocalTracesPerUser: 2,
MaxSpansPerTrace: 3,
IngestionMaxBatchSize: 4,
IngestionBurstSize: 4,
IngestionRateSpans: 5,
},
expectedMaxGlobalTraces: map[string]int{"user1": 1, "user2": 1},
Expand All @@ -47,7 +47,7 @@ func TestOverrides(t *testing.T) {
MaxGlobalTracesPerUser: 1,
MaxLocalTracesPerUser: 2,
MaxSpansPerTrace: 3,
IngestionMaxBatchSize: 4,
IngestionBurstSize: 4,
IngestionRateSpans: 5,
},
overrides: &perTenantOverrides{
Expand All @@ -56,7 +56,7 @@ func TestOverrides(t *testing.T) {
MaxGlobalTracesPerUser: 6,
MaxLocalTracesPerUser: 7,
MaxSpansPerTrace: 8,
IngestionMaxBatchSize: 9,
IngestionBurstSize: 9,
IngestionRateSpans: 10,
},
},
Expand Down Expand Up @@ -98,7 +98,7 @@ func TestOverrides(t *testing.T) {
}

for user, expectedVal := range tt.expectedIngestionBurstSpans {
assert.Equal(t, expectedVal, overrides.IngestionMaxBatchSize(user))
assert.Equal(t, expectedVal, overrides.IngestionBurstSize(user))
}

for user, expectedVal := range tt.expectedIngestionRateSpans {
Expand Down
2 changes: 1 addition & 1 deletion operations/jsonnet/microservices/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
super_user:: {
max_traces_per_user: 100000,
ingestion_rate_limit: 150000,
ingestion_max_batch_size: 5000,
ingestion_burst_size: 150000,
max_spans_per_trace: 200e3,
},
},
Expand Down

0 comments on commit a796195

Please sign in to comment.