1use std::time::Duration;
13
14use mz_dyncfg::{Config, ConfigSet};
15
16pub const ENABLE_HALF_JOIN2: Config<bool> = Config::new(
21 "enable_compute_half_join2",
22 true,
23 "Whether compute should use `half_join2` rather than DD's `half_join` to render delta joins.",
24);
25
26pub const ENABLE_MZ_JOIN_CORE: Config<bool> = Config::new(
28 "enable_mz_join_core",
29 true,
30 "Whether compute should use `mz_join_core` rather than DD's `JoinCore::join_core` to render \
31 linear joins.",
32);
33
34pub const ENABLE_CORRECTION_V2: Config<bool> = Config::new(
36 "enable_compute_correction_v2",
37 true,
38 "Whether compute should use the new MV sink correction buffer implementation.",
39);
40
41pub const CORRECTION_V2_CHAIN_PROPORTIONALITY: Config<f64> = Config::new(
43 "compute_correction_v2_chain_proportionality",
44 3.0,
45 "The size factor of subsequent chains in the correction V2 buffer.",
46);
47
48pub const CORRECTION_V2_CHUNK_SIZE: Config<usize> = Config::new(
50 "compute_correction_v2_chunk_size",
51 8 * 1024,
52 "The byte size of chunks in the correction V2 buffer.",
53);
54
55pub const ENABLE_TEMPORAL_BUCKETING: Config<bool> = Config::new(
57 "enable_compute_temporal_bucketing",
58 false,
59 "Whether to enable temporal bucketing in compute.",
60);
61
62pub const TEMPORAL_BUCKETING_SUMMARY: Config<Duration> = Config::new(
64 "compute_temporal_bucketing_summary",
65 Duration::from_secs(2),
66 "The summary to apply to frontiers in temporal bucketing in compute.",
67);
68
69pub const LINEAR_JOIN_YIELDING: Config<&str> = Config::new(
71 "linear_join_yielding",
72 "work:1000000,time:100",
73 "The yielding behavior compute rendering should apply for linear join operators. Either \
74 'work:<amount>' or 'time:<milliseconds>' or 'work:<amount>,time:<milliseconds>'. Note \
75 that omitting one of 'work' or 'time' will entirely disable join yielding by time or \
76 work, respectively, rather than falling back to some default.",
77);
78
79pub const ENABLE_LGALLOC: Config<bool> = Config::new("enable_lgalloc", true, "Enable lgalloc.");
81
82pub const ENABLE_LGALLOC_EAGER_RECLAMATION: Config<bool> = Config::new(
84 "enable_lgalloc_eager_reclamation",
85 true,
86 "Enable lgalloc's eager return behavior.",
87);
88
89pub const LGALLOC_BACKGROUND_INTERVAL: Config<Duration> = Config::new(
91 "lgalloc_background_interval",
92 Duration::from_secs(1),
93 "Scheduling interval for lgalloc's background worker.",
94);
95
96pub const LGALLOC_FILE_GROWTH_DAMPENER: Config<usize> = Config::new(
98 "lgalloc_file_growth_dampener",
99 2,
100 "Lgalloc's file growth dampener parameter.",
101);
102
103pub const LGALLOC_LOCAL_BUFFER_BYTES: Config<usize> = Config::new(
105 "lgalloc_local_buffer_bytes",
106 64 << 20,
107 "Lgalloc's local buffer bytes parameter.",
108);
109
110pub const LGALLOC_SLOW_CLEAR_BYTES: Config<usize> = Config::new(
112 "lgalloc_slow_clear_bytes",
113 128 << 20,
114 "Clear byte size per size class for every invocation",
115);
116
117pub const MEMORY_LIMITER_INTERVAL: Config<Duration> = Config::new(
119 "memory_limiter_interval",
120 Duration::from_secs(10),
121 "Interval to run the memory limiter. A zero duration disables the limiter.",
122);
123
124pub const MEMORY_LIMITER_USAGE_BIAS: Config<f64> = Config::new(
126 "memory_limiter_usage_bias",
127 1.,
128 "Multiplicative bias to the memory limiter's limit.",
129);
130
131pub const MEMORY_LIMITER_BURST_FACTOR: Config<f64> = Config::new(
133 "memory_limiter_burst_factor",
134 0.,
135 "Multiplicative burst factor to the memory limiter's limit.",
136);
137
138pub const ENABLE_COLUMNATION_LGALLOC: Config<bool> = Config::new(
140 "enable_columnation_lgalloc",
141 true,
142 "Enable allocating regions from lgalloc.",
143);
144
145pub const ENABLE_COLUMNAR_LGALLOC: Config<bool> = Config::new(
147 "enable_columnar_lgalloc",
148 true,
149 "Enable allocating aligned regions in columnar from lgalloc.",
150);
151
152pub const COMPUTE_SERVER_MAINTENANCE_INTERVAL: Config<Duration> = Config::new(
154 "compute_server_maintenance_interval",
155 Duration::from_millis(10),
156 "The interval at which the compute server performs maintenance tasks. Zero enables maintenance on every iteration.",
157);
158
159pub const DATAFLOW_MAX_INFLIGHT_BYTES: Config<Option<usize>> = Config::new(
161 "compute_dataflow_max_inflight_bytes",
162 None,
163 "The maximum number of in-flight bytes emitted by persist_sources feeding \
164 compute dataflows in non-cc clusters.",
165);
166
167pub const DATAFLOW_MAX_INFLIGHT_BYTES_CC: Config<Option<usize>> = Config::new(
172 "compute_dataflow_max_inflight_bytes_cc",
173 None,
174 "The maximum number of in-flight bytes emitted by persist_sources feeding \
175 compute dataflows in cc clusters.",
176);
177
178pub const CONSOLIDATING_VEC_GROWTH_DAMPENER: Config<usize> = Config::new(
181 "consolidating_vec_growth_dampener",
182 1,
183 "Dampener in growth rate for consolidating vector size",
184);
185
186pub const HYDRATION_CONCURRENCY: Config<usize> = Config::new(
188 "compute_hydration_concurrency",
189 4,
190 "Controls how many compute dataflows may hydrate concurrently.",
191);
192
193pub const COPY_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO: Config<usize> = Config::new(
195 "copy_to_s3_parquet_row_group_file_ratio",
196 20,
197 "The ratio (defined as a percentage) of row-group size to max-file-size. \
198 Must be <= 100.",
199);
200
201pub const COPY_TO_S3_ARROW_BUILDER_BUFFER_RATIO: Config<usize> = Config::new(
203 "copy_to_s3_arrow_builder_buffer_ratio",
204 150,
205 "The ratio (defined as a percentage) of arrow-builder size to row-group size. \
206 Must be >= 100.",
207);
208
209pub const COPY_TO_S3_MULTIPART_PART_SIZE_BYTES: Config<usize> = Config::new(
211 "copy_to_s3_multipart_part_size_bytes",
212 1024 * 1024 * 8,
213 "The size of each part in a multipart upload to S3.",
214);
215
216pub const ENABLE_COMPUTE_REPLICA_EXPIRATION: Config<bool> = Config::new(
220 "enable_compute_replica_expiration",
221 true,
222 "Main switch to disable replica expiration.",
223);
224
225pub const COMPUTE_REPLICA_EXPIRATION_OFFSET: Config<Duration> = Config::new(
231 "compute_replica_expiration_offset",
232 Duration::ZERO,
233 "The expiration time offset for replicas. Zero disables expiration.",
234);
235
236pub const COMPUTE_APPLY_COLUMN_DEMANDS: Config<bool> = Config::new(
240 "compute_apply_column_demands",
241 true,
242 "When enabled, passes applys column demands to the RelationDesc used to read out of Persist.",
243);
244
245pub const COMPUTE_FLAT_MAP_FUEL: Config<usize> = Config::new(
248 "compute_flat_map_fuel",
249 1_000_000,
250 "The amount of output the flat-map operator produces before yielding.",
251);
252
253pub const ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION: Config<bool> = Config::new(
255 "enable_compute_render_fueled_as_specific_collection",
256 true,
257 "When enabled, renders `as_specific_collection` using a fueled flat-map operator.",
258);
259
260pub const ENABLE_COMPUTE_LOGICAL_BACKPRESSURE: Config<bool> = Config::new(
262 "enable_compute_logical_backpressure",
263 false,
264 "When enabled, compute dataflows will apply logical backpressure.",
265);
266
267pub const COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES: Config<Option<usize>> =
276 Config::new(
277 "compute_logical_backpressure_max_retained_capabilities",
278 Some(30 * 24 * 60),
279 "The maximum number of capabilities retained by the logical backpressure operator.",
280 );
281
282pub const COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK: Config<Duration> = Config::new(
287 "compute_logical_backpressure_inflight_slack",
288 Duration::from_secs(1),
289 "Round observed timestamps to slack.",
290);
291
292pub const ENABLE_PEEK_RESPONSE_STASH: Config<bool> = Config::new(
296 "enable_compute_peek_response_stash",
297 true,
298 "Whether to enable the peek response stash, for sending back large peek responses. Will only be used for results that exceed compute_peek_response_stash_threshold_bytes.",
299);
300
301pub const PEEK_RESPONSE_STASH_THRESHOLD_BYTES: Config<usize> = Config::new(
305 "compute_peek_response_stash_threshold_bytes",
306 1024 * 10, "The threshold above which to use the peek response stash, for sending back large peek responses.",
308);
309
310pub const PEEK_RESPONSE_STASH_BATCH_MAX_RUNS: Config<usize> = Config::new(
317 "compute_peek_response_stash_batch_max_runs",
318 2,
321 "The target number of maximum runs in the batches written to the stash.",
322);
323
324pub const PEEK_RESPONSE_STASH_READ_BATCH_SIZE_BYTES: Config<usize> = Config::new(
326 "compute_peek_response_stash_read_batch_size_bytes",
327 1024 * 1024 * 100, "The target size for batches of rows we read out of the peek stash.",
329);
330
331pub const PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES: Config<usize> = Config::new(
334 "compute_peek_response_stash_read_memory_budget_bytes",
335 1024 * 1024 * 64, "The memory budget for consolidating stashed peek responses in environmentd.",
337);
338
339pub const PEEK_STASH_NUM_BATCHES: Config<usize> = Config::new(
341 "compute_peek_stash_num_batches",
342 100,
343 "The number of batches to pump from the peek result iterator (in one iteration through the worker loop) when stashing peek responses.",
344);
345
346pub const PEEK_STASH_BATCH_SIZE: Config<usize> = Config::new(
349 "compute_peek_stash_batch_size",
350 100000,
351 "The size, as number of rows, of each batch pumped from the peek result iterator (in one iteration through the worker loop) when stashing peek responses.",
352);
353
354pub const COMPUTE_PROMETHEUS_INTROSPECTION_SCRAPE_INTERVAL: Config<Duration> = Config::new(
358 "compute_prometheus_introspection_scrape_interval",
359 Duration::from_secs(1),
360 "The collection interval for the Prometheus metrics introspection source. Set to zero to disable.",
361);
362
363pub const SUBSCRIBE_SNAPSHOT_OPTIMIZATION: Config<bool> = Config::new(
365 "compute_subscribe_snapshot_optimization",
366 true,
367 "If set, skip fetching or processing the snapshot data for subscribes when possible.",
368);
369
370pub const MV_SINK_ADVANCE_PERSIST_FRONTIERS: Config<bool> = Config::new(
374 "compute_mv_sink_advance_persist_frontiers",
375 true,
376 "Whether the MV sink's write operator advances its internal persist frontiers to the as_of.",
377);
378
379pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
381 configs
382 .add(&ENABLE_HALF_JOIN2)
383 .add(&ENABLE_MZ_JOIN_CORE)
384 .add(&ENABLE_CORRECTION_V2)
385 .add(&CORRECTION_V2_CHAIN_PROPORTIONALITY)
386 .add(&CORRECTION_V2_CHUNK_SIZE)
387 .add(&ENABLE_TEMPORAL_BUCKETING)
388 .add(&TEMPORAL_BUCKETING_SUMMARY)
389 .add(&LINEAR_JOIN_YIELDING)
390 .add(&ENABLE_LGALLOC)
391 .add(&LGALLOC_BACKGROUND_INTERVAL)
392 .add(&LGALLOC_FILE_GROWTH_DAMPENER)
393 .add(&LGALLOC_LOCAL_BUFFER_BYTES)
394 .add(&LGALLOC_SLOW_CLEAR_BYTES)
395 .add(&MEMORY_LIMITER_INTERVAL)
396 .add(&MEMORY_LIMITER_USAGE_BIAS)
397 .add(&MEMORY_LIMITER_BURST_FACTOR)
398 .add(&ENABLE_LGALLOC_EAGER_RECLAMATION)
399 .add(&ENABLE_COLUMNATION_LGALLOC)
400 .add(&ENABLE_COLUMNAR_LGALLOC)
401 .add(&COMPUTE_SERVER_MAINTENANCE_INTERVAL)
402 .add(&DATAFLOW_MAX_INFLIGHT_BYTES)
403 .add(&DATAFLOW_MAX_INFLIGHT_BYTES_CC)
404 .add(&HYDRATION_CONCURRENCY)
405 .add(©_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO)
406 .add(©_TO_S3_ARROW_BUILDER_BUFFER_RATIO)
407 .add(©_TO_S3_MULTIPART_PART_SIZE_BYTES)
408 .add(&ENABLE_COMPUTE_REPLICA_EXPIRATION)
409 .add(&COMPUTE_REPLICA_EXPIRATION_OFFSET)
410 .add(&COMPUTE_APPLY_COLUMN_DEMANDS)
411 .add(&COMPUTE_FLAT_MAP_FUEL)
412 .add(&CONSOLIDATING_VEC_GROWTH_DAMPENER)
413 .add(&ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION)
414 .add(&ENABLE_COMPUTE_LOGICAL_BACKPRESSURE)
415 .add(&COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES)
416 .add(&COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK)
417 .add(&ENABLE_PEEK_RESPONSE_STASH)
418 .add(&PEEK_RESPONSE_STASH_THRESHOLD_BYTES)
419 .add(&PEEK_RESPONSE_STASH_BATCH_MAX_RUNS)
420 .add(&PEEK_RESPONSE_STASH_READ_BATCH_SIZE_BYTES)
421 .add(&PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES)
422 .add(&PEEK_STASH_NUM_BATCHES)
423 .add(&PEEK_STASH_BATCH_SIZE)
424 .add(&COMPUTE_PROMETHEUS_INTROSPECTION_SCRAPE_INTERVAL)
425 .add(&SUBSCRIBE_SNAPSHOT_OPTIMIZATION)
426 .add(&MV_SINK_ADVANCE_PERSIST_FRONTIERS)
427}