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_COLUMN_PAGED_BATCHER: Config<bool> = Config::new(
40 "enable_column_paged_batcher",
41 false,
42 "Use the columnar-native paged merge batcher at arrange sites. When `false` (default), \
43 arranges fall back to the legacy columnation `Col2ValBatcher` / `RowRowBuilder` path.",
44);
45
46pub const ENABLE_COLUMN_PAGED_BATCHER_SPILL: Config<bool> = Config::new(
55 "enable_column_paged_batcher_spill",
56 false,
57 "Allow the column-paged batcher's pager to evict chunks under memory pressure. Only \
58 meaningful when `enable_column_paged_batcher = true`.",
59);
60
61pub const COLUMN_PAGED_BATCHER_BUDGET_FRACTION: Config<f64> = Config::new(
76 "column_paged_batcher_budget_fraction",
77 0.05,
78 "Fraction of replica memory the column-paged batcher's tiered policy may hold resident \
79 before spilling to the backend. Total budget = max(mem_limit * fraction, 128 MiB).",
80);
81
82pub const ENABLE_MZ_JOIN_CORE: Config<bool> = Config::new(
84 "enable_mz_join_core",
85 true,
86 "Whether compute should use `mz_join_core` rather than DD's `JoinCore::join_core` to render \
87 linear joins.",
88);
89
90pub const ENABLE_SYNC_MV_SINK: Config<bool> = Config::new(
92 "enable_compute_sync_mv_sink",
93 true,
94 "Use sync Timely operators with Tokio tasks for the MV sink.",
95);
96
97pub const ENABLE_CORRECTION_V2: Config<bool> = Config::new(
99 "enable_compute_correction_v2",
100 true,
101 "Whether compute should use the new MV sink correction buffer implementation.",
102);
103
104pub const CORRECTION_V2_CHAIN_PROPORTIONALITY: Config<f64> = Config::new(
106 "compute_correction_v2_chain_proportionality",
107 3.0,
108 "The size factor of subsequent chains in the correction V2 buffer.",
109);
110
111pub const CORRECTION_V2_CHUNK_SIZE: Config<usize> = Config::new(
113 "compute_correction_v2_chunk_size",
114 8 * 1024,
115 "The byte size of chunks in the correction V2 buffer.",
116);
117
118pub const ENABLE_COMPUTE_TEMPORAL_BUCKETING: Config<bool> = Config::new(
120 "enable_compute_temporal_bucketing",
121 false,
122 "Whether to enable temporal bucketing in compute.",
123);
124
125pub const TEMPORAL_BUCKETING_SUMMARY: Config<Duration> = Config::new(
127 "compute_temporal_bucketing_summary",
128 Duration::from_secs(2),
129 "The summary to apply to frontiers in temporal bucketing in compute.",
130);
131
132pub const LINEAR_JOIN_YIELDING: Config<&str> = Config::new(
134 "linear_join_yielding",
135 "work:1000000,time:100",
136 "The yielding behavior compute rendering should apply for linear join operators. Either \
137 'work:<amount>' or 'time:<milliseconds>' or 'work:<amount>,time:<milliseconds>'. Note \
138 that omitting one of 'work' or 'time' will entirely disable join yielding by time or \
139 work, respectively, rather than falling back to some default.",
140);
141
142pub const ENABLE_LGALLOC: Config<bool> = Config::new("enable_lgalloc", true, "Enable lgalloc.");
144
145pub const ENABLE_LGALLOC_EAGER_RECLAMATION: Config<bool> = Config::new(
147 "enable_lgalloc_eager_reclamation",
148 true,
149 "Enable lgalloc's eager return behavior.",
150);
151
152pub const LGALLOC_BACKGROUND_INTERVAL: Config<Duration> = Config::new(
154 "lgalloc_background_interval",
155 Duration::from_secs(1),
156 "Scheduling interval for lgalloc's background worker.",
157);
158
159pub const LGALLOC_FILE_GROWTH_DAMPENER: Config<usize> = Config::new(
161 "lgalloc_file_growth_dampener",
162 2,
163 "Lgalloc's file growth dampener parameter.",
164);
165
166pub const LGALLOC_LOCAL_BUFFER_BYTES: Config<usize> = Config::new(
168 "lgalloc_local_buffer_bytes",
169 64 << 20,
170 "Lgalloc's local buffer bytes parameter.",
171);
172
173pub const LGALLOC_SLOW_CLEAR_BYTES: Config<usize> = Config::new(
175 "lgalloc_slow_clear_bytes",
176 128 << 20,
177 "Clear byte size per size class for every invocation",
178);
179
180pub const MEMORY_LIMITER_INTERVAL: Config<Duration> = Config::new(
182 "memory_limiter_interval",
183 Duration::from_secs(10),
184 "Interval to run the memory limiter. A zero duration disables the limiter.",
185);
186
187pub const MEMORY_LIMITER_USAGE_BIAS: Config<f64> = Config::new(
189 "memory_limiter_usage_bias",
190 1.,
191 "Multiplicative bias to the memory limiter's limit.",
192);
193
194pub const MEMORY_LIMITER_BURST_FACTOR: Config<f64> = Config::new(
196 "memory_limiter_burst_factor",
197 0.,
198 "Multiplicative burst factor to the memory limiter's limit.",
199);
200
201pub const ENABLE_COLUMNATION_LGALLOC: Config<bool> = Config::new(
203 "enable_columnation_lgalloc",
204 true,
205 "Enable allocating regions from lgalloc.",
206);
207
208pub const COMPUTE_SERVER_MAINTENANCE_INTERVAL: Config<Duration> = Config::new(
210 "compute_server_maintenance_interval",
211 Duration::from_millis(10),
212 "The interval at which the compute server performs maintenance tasks. Zero enables maintenance on every iteration.",
213);
214
215pub const DATAFLOW_MAX_INFLIGHT_BYTES: Config<Option<usize>> = Config::new(
217 "compute_dataflow_max_inflight_bytes",
218 None,
219 "The maximum number of in-flight bytes emitted by persist_sources feeding \
220 compute dataflows in non-cc clusters.",
221);
222
223pub const DATAFLOW_MAX_INFLIGHT_BYTES_CC: Config<Option<usize>> = Config::new(
228 "compute_dataflow_max_inflight_bytes_cc",
229 None,
230 "The maximum number of in-flight bytes emitted by persist_sources feeding \
231 compute dataflows in cc clusters.",
232);
233
234pub const CONSOLIDATING_VEC_GROWTH_DAMPENER: Config<usize> = Config::new(
237 "consolidating_vec_growth_dampener",
238 1,
239 "Dampener in growth rate for consolidating vector size",
240);
241
242pub const HYDRATION_CONCURRENCY: Config<usize> = Config::new(
244 "compute_hydration_concurrency",
245 4,
246 "Controls how many compute dataflows may hydrate concurrently.",
247);
248
249pub const COPY_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO: Config<usize> = Config::new(
251 "copy_to_s3_parquet_row_group_file_ratio",
252 20,
253 "The ratio (defined as a percentage) of row-group size to max-file-size. \
254 Must be <= 100.",
255);
256
257pub const COPY_TO_S3_ARROW_BUILDER_BUFFER_RATIO: Config<usize> = Config::new(
259 "copy_to_s3_arrow_builder_buffer_ratio",
260 150,
261 "The ratio (defined as a percentage) of arrow-builder size to row-group size. \
262 Must be >= 100.",
263);
264
265pub const COPY_TO_S3_MULTIPART_PART_SIZE_BYTES: Config<usize> = Config::new(
267 "copy_to_s3_multipart_part_size_bytes",
268 1024 * 1024 * 8,
269 "The size of each part in a multipart upload to S3.",
270);
271
272pub const ENABLE_COMPUTE_REPLICA_EXPIRATION: Config<bool> = Config::new(
276 "enable_compute_replica_expiration",
277 true,
278 "Main switch to disable replica expiration.",
279);
280
281pub const COMPUTE_REPLICA_EXPIRATION_OFFSET: Config<Duration> = Config::new(
287 "compute_replica_expiration_offset",
288 Duration::ZERO,
289 "The expiration time offset for replicas. Zero disables expiration.",
290);
291
292pub const COMPUTE_APPLY_COLUMN_DEMANDS: Config<bool> = Config::new(
296 "compute_apply_column_demands",
297 true,
298 "When enabled, passes applys column demands to the RelationDesc used to read out of Persist.",
299);
300
301pub const COMPUTE_FLAT_MAP_FUEL: Config<usize> = Config::new(
304 "compute_flat_map_fuel",
305 1_000_000,
306 "The amount of output the flat-map operator produces before yielding.",
307);
308
309pub const ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION: Config<bool> = Config::new(
311 "enable_compute_render_fueled_as_specific_collection",
312 true,
313 "When enabled, renders `as_specific_collection` using a fueled flat-map operator.",
314);
315
316pub const ENABLE_COMPUTE_LOGICAL_BACKPRESSURE: Config<bool> = Config::new(
318 "enable_compute_logical_backpressure",
319 false,
320 "When enabled, compute dataflows will apply logical backpressure.",
321);
322
323pub const COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES: Config<Option<usize>> =
332 Config::new(
333 "compute_logical_backpressure_max_retained_capabilities",
334 Some(30 * 24 * 60),
335 "The maximum number of capabilities retained by the logical backpressure operator.",
336 );
337
338pub const COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK: Config<Duration> = Config::new(
343 "compute_logical_backpressure_inflight_slack",
344 Duration::from_secs(1),
345 "Round observed timestamps to slack.",
346);
347
348pub const ENABLE_PEEK_RESPONSE_STASH: Config<bool> = Config::new(
352 "enable_compute_peek_response_stash",
353 true,
354 "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.",
355);
356
357pub const PEEK_RESPONSE_STASH_THRESHOLD_BYTES: Config<usize> = Config::new(
361 "compute_peek_response_stash_threshold_bytes",
362 1024 * 10, "The threshold above which to use the peek response stash, for sending back large peek responses.",
364);
365
366pub const PEEK_RESPONSE_STASH_BATCH_MAX_RUNS: Config<usize> = Config::new(
373 "compute_peek_response_stash_batch_max_runs",
374 2,
377 "The target number of maximum runs in the batches written to the stash.",
378);
379
380pub const PEEK_RESPONSE_STASH_READ_BATCH_SIZE_BYTES: Config<usize> = Config::new(
382 "compute_peek_response_stash_read_batch_size_bytes",
383 1024 * 1024 * 100, "The target size for batches of rows we read out of the peek stash.",
385);
386
387pub const PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES: Config<usize> = Config::new(
390 "compute_peek_response_stash_read_memory_budget_bytes",
391 1024 * 1024 * 64, "The memory budget for consolidating stashed peek responses in environmentd.",
393);
394
395pub const PEEK_STASH_NUM_BATCHES: Config<usize> = Config::new(
397 "compute_peek_stash_num_batches",
398 100,
399 "The number of batches to pump from the peek result iterator (in one iteration through the worker loop) when stashing peek responses.",
400);
401
402pub const PEEK_STASH_BATCH_SIZE: Config<usize> = Config::new(
405 "compute_peek_stash_batch_size",
406 100000,
407 "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.",
408);
409
410pub const COMPUTE_PROMETHEUS_INTROSPECTION_SCRAPE_INTERVAL: Config<Duration> = Config::new(
414 "compute_prometheus_introspection_scrape_interval",
415 Duration::from_secs(1),
416 "The collection interval for the Prometheus metrics introspection source. Set to zero to disable.",
417);
418
419pub const SUBSCRIBE_SNAPSHOT_OPTIMIZATION: Config<bool> = Config::new(
421 "compute_subscribe_snapshot_optimization",
422 true,
423 "If set, skip fetching or processing the snapshot data for subscribes when possible.",
424);
425
426pub const MV_SINK_ADVANCE_PERSIST_FRONTIERS: Config<bool> = Config::new(
430 "compute_mv_sink_advance_persist_frontiers",
431 true,
432 "Whether the MV sink's write operator advances its internal persist frontiers to the as_of.",
433);
434
435pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
437 configs
438 .add(&ENABLE_HALF_JOIN2)
439 .add(&ENABLE_MZ_JOIN_CORE)
440 .add(&ENABLE_SYNC_MV_SINK)
441 .add(&ENABLE_CORRECTION_V2)
442 .add(&CORRECTION_V2_CHAIN_PROPORTIONALITY)
443 .add(&CORRECTION_V2_CHUNK_SIZE)
444 .add(&ENABLE_COMPUTE_TEMPORAL_BUCKETING)
445 .add(&TEMPORAL_BUCKETING_SUMMARY)
446 .add(&LINEAR_JOIN_YIELDING)
447 .add(&ENABLE_LGALLOC)
448 .add(&LGALLOC_BACKGROUND_INTERVAL)
449 .add(&LGALLOC_FILE_GROWTH_DAMPENER)
450 .add(&LGALLOC_LOCAL_BUFFER_BYTES)
451 .add(&LGALLOC_SLOW_CLEAR_BYTES)
452 .add(&MEMORY_LIMITER_INTERVAL)
453 .add(&MEMORY_LIMITER_USAGE_BIAS)
454 .add(&MEMORY_LIMITER_BURST_FACTOR)
455 .add(&ENABLE_LGALLOC_EAGER_RECLAMATION)
456 .add(&ENABLE_COLUMNATION_LGALLOC)
457 .add(&COMPUTE_SERVER_MAINTENANCE_INTERVAL)
458 .add(&DATAFLOW_MAX_INFLIGHT_BYTES)
459 .add(&DATAFLOW_MAX_INFLIGHT_BYTES_CC)
460 .add(&HYDRATION_CONCURRENCY)
461 .add(©_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO)
462 .add(©_TO_S3_ARROW_BUILDER_BUFFER_RATIO)
463 .add(©_TO_S3_MULTIPART_PART_SIZE_BYTES)
464 .add(&ENABLE_COMPUTE_REPLICA_EXPIRATION)
465 .add(&COMPUTE_REPLICA_EXPIRATION_OFFSET)
466 .add(&COMPUTE_APPLY_COLUMN_DEMANDS)
467 .add(&COMPUTE_FLAT_MAP_FUEL)
468 .add(&CONSOLIDATING_VEC_GROWTH_DAMPENER)
469 .add(&ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION)
470 .add(&ENABLE_COMPUTE_LOGICAL_BACKPRESSURE)
471 .add(&COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES)
472 .add(&COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK)
473 .add(&ENABLE_PEEK_RESPONSE_STASH)
474 .add(&PEEK_RESPONSE_STASH_THRESHOLD_BYTES)
475 .add(&PEEK_RESPONSE_STASH_BATCH_MAX_RUNS)
476 .add(&PEEK_RESPONSE_STASH_READ_BATCH_SIZE_BYTES)
477 .add(&PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES)
478 .add(&PEEK_STASH_NUM_BATCHES)
479 .add(&PEEK_STASH_BATCH_SIZE)
480 .add(&COMPUTE_PROMETHEUS_INTROSPECTION_SCRAPE_INTERVAL)
481 .add(&SUBSCRIBE_SNAPSHOT_OPTIMIZATION)
482 .add(&MV_SINK_ADVANCE_PERSIST_FRONTIERS)
483 .add(&ENABLE_COLUMN_PAGED_BATCHER)
484 .add(&ENABLE_COLUMN_PAGED_BATCHER_SPILL)
485 .add(&COLUMN_PAGED_BATCHER_BUDGET_FRACTION)
486}