Skip to content

Commit 42119dc

Browse files
authored
feat(adaptive_concurrency): support configuring the initial ARC limit (#18175)
* feat(adaptive_concurrency): support configuring the initial ARC limit * docs: update component docs for new arc configuration * replace option with default value and add range validation * update docs
1 parent 923eb45 commit 42119dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+457
-1
lines changed

src/sinks/util/adaptive_concurrency/controller.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl<L> Controller<L> {
6969
// current limit and the maximum, effectively bypassing all the
7070
// mechanisms. Otherwise, the current limit is set to 1 and the
7171
// maximum to MAX_CONCURRENCY.
72-
let current_limit = concurrency.unwrap_or(1);
72+
let current_limit = concurrency.unwrap_or(settings.initial_concurrency);
7373
Self {
7474
semaphore: Arc::new(ShrinkableSemaphore::new(current_limit)),
7575
concurrency,

src/sinks/util/adaptive_concurrency/mod.rs

+16
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ mod service;
99
#[cfg(test)]
1010
pub mod tests;
1111

12+
// Make sure to update the max range of the `AdaptiveConcurrencySettings::initial_concurrency` when changing
13+
// this constant.
1214
pub(super) const MAX_CONCURRENCY: usize = 200;
1315

1416
pub(crate) use layer::AdaptiveConcurrencyLimitLayer;
@@ -29,6 +31,15 @@ pub(self) fn instant_now() -> std::time::Instant {
2931
#[derive(Clone, Copy, Debug)]
3032
#[serde(deny_unknown_fields)]
3133
pub struct AdaptiveConcurrencySettings {
34+
/// The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
35+
///
36+
/// It is recommended to set this value to your service's average limit if you're seeing that it takes a
37+
/// long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
38+
/// `adaptive_concurrency_limit` metric.
39+
#[configurable(validation(range(min = 1, max = 200)))]
40+
#[serde(default = "default_initial_concurrency")]
41+
pub(super) initial_concurrency: usize,
42+
3243
/// The fraction of the current value to set the new concurrency limit when decreasing the limit.
3344
///
3445
/// Valid values are greater than `0` and less than `1`. Smaller values cause the algorithm to scale back rapidly
@@ -63,6 +74,10 @@ pub struct AdaptiveConcurrencySettings {
6374
pub(super) rtt_deviation_scale: f64,
6475
}
6576

77+
const fn default_initial_concurrency() -> usize {
78+
1
79+
}
80+
6681
const fn default_decrease_ratio() -> f64 {
6782
0.9
6883
}
@@ -84,6 +99,7 @@ impl AdaptiveConcurrencySettings {
8499
impl Default for AdaptiveConcurrencySettings {
85100
fn default() -> Self {
86101
Self {
102+
initial_concurrency: default_initial_concurrency(),
87103
decrease_ratio: default_decrease_ratio(),
88104
ewma_alpha: default_ewma_alpha(),
89105
rtt_deviation_scale: default_rtt_deviation_scale(),

website/cue/reference/components/sinks/base/appsignal.cue

+11
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,17 @@ base: components: sinks: appsignal: configuration: {
170170
required: false
171171
type: float: default: 0.4
172172
}
173+
initial_concurrency: {
174+
description: """
175+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
176+
177+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
178+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
179+
`adaptive_concurrency_limit` metric.
180+
"""
181+
required: false
182+
type: uint: default: 1
183+
}
173184
rtt_deviation_scale: {
174185
description: """
175186
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/aws_cloudwatch_logs.cue

+11
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,17 @@ base: components: sinks: aws_cloudwatch_logs: configuration: {
417417
required: false
418418
type: float: default: 0.4
419419
}
420+
initial_concurrency: {
421+
description: """
422+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
423+
424+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
425+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
426+
`adaptive_concurrency_limit` metric.
427+
"""
428+
required: false
429+
type: uint: default: 1
430+
}
420431
rtt_deviation_scale: {
421432
description: """
422433
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/aws_cloudwatch_metrics.cue

+11
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,17 @@ base: components: sinks: aws_cloudwatch_metrics: configuration: {
258258
required: false
259259
type: float: default: 0.4
260260
}
261+
initial_concurrency: {
262+
description: """
263+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
264+
265+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
266+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
267+
`adaptive_concurrency_limit` metric.
268+
"""
269+
required: false
270+
type: uint: default: 1
271+
}
261272
rtt_deviation_scale: {
262273
description: """
263274
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/aws_kinesis_firehose.cue

+11
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,17 @@ base: components: sinks: aws_kinesis_firehose: configuration: {
388388
required: false
389389
type: float: default: 0.4
390390
}
391+
initial_concurrency: {
392+
description: """
393+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
394+
395+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
396+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
397+
`adaptive_concurrency_limit` metric.
398+
"""
399+
required: false
400+
type: uint: default: 1
401+
}
391402
rtt_deviation_scale: {
392403
description: """
393404
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/aws_kinesis_streams.cue

+11
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,17 @@ base: components: sinks: aws_kinesis_streams: configuration: {
397397
required: false
398398
type: float: default: 0.4
399399
}
400+
initial_concurrency: {
401+
description: """
402+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
403+
404+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
405+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
406+
`adaptive_concurrency_limit` metric.
407+
"""
408+
required: false
409+
type: uint: default: 1
410+
}
400411
rtt_deviation_scale: {
401412
description: """
402413
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/aws_s3.cue

+11
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,17 @@ base: components: sinks: aws_s3: configuration: {
634634
required: false
635635
type: float: default: 0.4
636636
}
637+
initial_concurrency: {
638+
description: """
639+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
640+
641+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
642+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
643+
`adaptive_concurrency_limit` metric.
644+
"""
645+
required: false
646+
type: uint: default: 1
647+
}
637648
rtt_deviation_scale: {
638649
description: """
639650
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/aws_sqs.cue

+11
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,17 @@ base: components: sinks: aws_sqs: configuration: {
350350
required: false
351351
type: float: default: 0.4
352352
}
353+
initial_concurrency: {
354+
description: """
355+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
356+
357+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
358+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
359+
`adaptive_concurrency_limit` metric.
360+
"""
361+
required: false
362+
type: uint: default: 1
363+
}
353364
rtt_deviation_scale: {
354365
description: """
355366
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/axiom.cue

+11
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ base: components: sinks: axiom: configuration: {
108108
required: false
109109
type: float: default: 0.4
110110
}
111+
initial_concurrency: {
112+
description: """
113+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
114+
115+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
116+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
117+
`adaptive_concurrency_limit` metric.
118+
"""
119+
required: false
120+
type: uint: default: 1
121+
}
111122
rtt_deviation_scale: {
112123
description: """
113124
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/azure_blob.cue

+11
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,17 @@ base: components: sinks: azure_blob: configuration: {
382382
required: false
383383
type: float: default: 0.4
384384
}
385+
initial_concurrency: {
386+
description: """
387+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
388+
389+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
390+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
391+
`adaptive_concurrency_limit` metric.
392+
"""
393+
required: false
394+
type: uint: default: 1
395+
}
385396
rtt_deviation_scale: {
386397
description: """
387398
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/azure_monitor_logs.cue

+11
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ base: components: sinks: azure_monitor_logs: configuration: {
166166
required: false
167167
type: float: default: 0.4
168168
}
169+
initial_concurrency: {
170+
description: """
171+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
172+
173+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
174+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
175+
`adaptive_concurrency_limit` metric.
176+
"""
177+
required: false
178+
type: uint: default: 1
179+
}
169180
rtt_deviation_scale: {
170181
description: """
171182
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/clickhouse.cue

+11
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,17 @@ base: components: sinks: clickhouse: configuration: {
219219
required: false
220220
type: float: default: 0.4
221221
}
222+
initial_concurrency: {
223+
description: """
224+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
225+
226+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
227+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
228+
`adaptive_concurrency_limit` metric.
229+
"""
230+
required: false
231+
type: uint: default: 1
232+
}
222233
rtt_deviation_scale: {
223234
description: """
224235
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/databend.cue

+11
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,17 @@ base: components: sinks: databend: configuration: {
258258
required: false
259259
type: float: default: 0.4
260260
}
261+
initial_concurrency: {
262+
description: """
263+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
264+
265+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
266+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
267+
`adaptive_concurrency_limit` metric.
268+
"""
269+
required: false
270+
type: uint: default: 1
271+
}
261272
rtt_deviation_scale: {
262273
description: """
263274
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/datadog_events.cue

+11
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ base: components: sinks: datadog_events: configuration: {
103103
required: false
104104
type: float: default: 0.4
105105
}
106+
initial_concurrency: {
107+
description: """
108+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
109+
110+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
111+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
112+
`adaptive_concurrency_limit` metric.
113+
"""
114+
required: false
115+
type: uint: default: 1
116+
}
106117
rtt_deviation_scale: {
107118
description: """
108119
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/datadog_logs.cue

+11
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,17 @@ base: components: sinks: datadog_logs: configuration: {
184184
required: false
185185
type: float: default: 0.4
186186
}
187+
initial_concurrency: {
188+
description: """
189+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
190+
191+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
192+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
193+
`adaptive_concurrency_limit` metric.
194+
"""
195+
required: false
196+
type: uint: default: 1
197+
}
187198
rtt_deviation_scale: {
188199
description: """
189200
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/datadog_metrics.cue

+11
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ base: components: sinks: datadog_metrics: configuration: {
145145
required: false
146146
type: float: default: 0.4
147147
}
148+
initial_concurrency: {
149+
description: """
150+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
151+
152+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
153+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
154+
`adaptive_concurrency_limit` metric.
155+
"""
156+
required: false
157+
type: uint: default: 1
158+
}
148159
rtt_deviation_scale: {
149160
description: """
150161
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/datadog_traces.cue

+11
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ base: components: sinks: datadog_traces: configuration: {
154154
required: false
155155
type: float: default: 0.4
156156
}
157+
initial_concurrency: {
158+
description: """
159+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
160+
161+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
162+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
163+
`adaptive_concurrency_limit` metric.
164+
"""
165+
required: false
166+
type: uint: default: 1
167+
}
157168
rtt_deviation_scale: {
158169
description: """
159170
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/elasticsearch.cue

+11
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,17 @@ base: components: sinks: elasticsearch: configuration: {
571571
required: false
572572
type: float: default: 0.4
573573
}
574+
initial_concurrency: {
575+
description: """
576+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
577+
578+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
579+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
580+
`adaptive_concurrency_limit` metric.
581+
"""
582+
required: false
583+
type: uint: default: 1
584+
}
574585
rtt_deviation_scale: {
575586
description: """
576587
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/gcp_chronicle_unstructured.cue

+11
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,17 @@ base: components: sinks: gcp_chronicle_unstructured: configuration: {
306306
required: false
307307
type: float: default: 0.4
308308
}
309+
initial_concurrency: {
310+
description: """
311+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
312+
313+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
314+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
315+
`adaptive_concurrency_limit` metric.
316+
"""
317+
required: false
318+
type: uint: default: 1
319+
}
309320
rtt_deviation_scale: {
310321
description: """
311322
Scale of RTT deviations which are not considered anomalous.

website/cue/reference/components/sinks/base/gcp_cloud_storage.cue

+11
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,17 @@ base: components: sinks: gcp_cloud_storage: configuration: {
465465
required: false
466466
type: float: default: 0.4
467467
}
468+
initial_concurrency: {
469+
description: """
470+
The initial concurrency limit to use. If not specified, the initial limit will be 1 (no concurrency).
471+
472+
It is recommended to set this value to your service's average limit if you're seeing that it takes a
473+
long time to ramp up adaptive concurrency after a restart. You can find this value by looking at the
474+
`adaptive_concurrency_limit` metric.
475+
"""
476+
required: false
477+
type: uint: default: 1
478+
}
468479
rtt_deviation_scale: {
469480
description: """
470481
Scale of RTT deviations which are not considered anomalous.

0 commit comments

Comments
 (0)