1use std::time::Duration;
13
14use mz_dyncfg::{Config, ConfigSet, ParameterScope};
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 ParameterScope::Environment,
25);
26
27pub const ENABLE_ERROR_DISTINCT: Config<bool> = Config::new(
40 "enable_compute_error_distinct",
41 true,
42 "Whether compute rendering should collapse error multiplicities to one where it arranges \
43 errors.",
44 ParameterScope::Environment,
45);
46
47pub const ENABLE_COLUMN_PAGED_BATCHER: Config<bool> = Config::new(
60 "enable_column_paged_batcher",
61 false,
62 "Use the columnar-native paged merge batcher at arrange sites. When `false` (default), \
63 arranges fall back to the legacy columnation `Col2ValBatcher` / `RowRowBuilder` path.",
64 ParameterScope::Replica,
65);
66
67pub const ENABLE_COLUMN_PAGED_BATCHER_SPILL: Config<bool> = Config::new(
82 "enable_column_paged_batcher_spill",
83 false,
84 "Allow the column-paged batcher's pager to evict chunks under memory pressure. Only \
85 meaningful when `enable_column_paged_batcher = true`.",
86 ParameterScope::Replica,
87);
88
89pub const COLUMN_PAGED_BATCHER_BUDGET_FRACTION: Config<f64> = Config::new(
104 "column_paged_batcher_budget_fraction",
105 0.05,
106 "Budget fraction for chunk spilling: the buffer pool multiplies it against physical \
107 RAM and the column pager's tiered policy against the announced memory limit. \
108 Total pool budget = max(ram * fraction, 128 MiB).",
109 ParameterScope::Replica,
110);
111
112pub const COLUMN_PAGED_BATCHER_SPILL_WORKER_COUNT: Config<usize> = Config::new(
120 "column_paged_batcher_spill_worker_count",
121 2,
122 "Buffer-pool spill threads for off-worker eviction I/O; 0 evicts inline on the caller.",
123 ParameterScope::Replica,
124);
125
126pub const COLUMN_PAGED_BATCHER_LZ4: Config<bool> = Config::new(
134 "column_paged_batcher_lz4",
135 false,
136 "Compress column-paged batcher chunks with lz4 on the spill path. Only meaningful when \
137 `enable_column_paged_batcher_spill = true`.",
138 ParameterScope::Replica,
139);
140
141pub const COLUMN_PAGED_BATCHER_SWAP_PAGEOUT: Config<bool> = Config::new(
156 "column_paged_batcher_swap_pageout",
157 false,
158 "Eagerly evict the column-paged batcher's lz4-compressed swap-backend spill chunks from RSS \
159 via `MADV_PAGEOUT` (they otherwise receive no madvise and are reclaimed only lazily). Only \
160 meaningful when `column_paged_batcher_lz4 = true` and the swap backend is active.",
161 ParameterScope::Replica,
162);
163
164pub const COLUMN_PAGED_BATCHER_EAGER_BACKING: Config<bool> = Config::new(
171 "column_paged_batcher_eager_backing",
172 false,
173 "Eagerly compress buffer-pool chunks to compressed-but-resident on idle spill threads, so \
174 budget-driven eviction is a pure page release. Only meaningful with spill workers.",
175 ParameterScope::Replica,
176);
177
178pub const COLUMN_PAGED_BATCHER_POOL_RSS_TARGET_FRACTION: Config<f64> = Config::new(
193 "column_paged_batcher_pool_rss_target_fraction",
194 0.25,
195 "Ceiling on the buffer pool's total RSS as a fraction of physical RAM; the headroom above \
196 the slot budget holds compressed-but-resident extents. Zero pages extents out immediately.",
197 ParameterScope::Replica,
198);
199
200pub const ENABLE_MZ_JOIN_CORE: Config<bool> = Config::new(
202 "enable_mz_join_core",
203 true,
204 "Whether compute should use `mz_join_core` rather than DD's `JoinCore::join_core` to render \
205 linear joins.",
206 ParameterScope::Environment,
207);
208
209pub const ENABLE_SYNC_MV_SINK: Config<bool> = Config::new(
211 "enable_compute_sync_mv_sink",
212 false,
213 "Use sync Timely operators with Tokio tasks for the MV sink.",
214 ParameterScope::Environment,
215);
216
217pub const ENABLE_CORRECTION_V2: Config<bool> = Config::new(
219 "enable_compute_correction_v2",
220 true,
221 "Whether compute should use the new MV sink correction buffer implementation.",
222 ParameterScope::Environment,
223);
224
225pub const CORRECTION_V2_CHAIN_PROPORTIONALITY: Config<f64> = Config::new(
227 "compute_correction_v2_chain_proportionality",
228 3.0,
229 "The size factor of subsequent chains in the correction V2 buffer.",
230 ParameterScope::Replica,
231);
232
233pub const CORRECTION_V2_CHUNK_SIZE: Config<usize> = Config::new(
235 "compute_correction_v2_chunk_size",
236 8 * 1024,
237 "The byte size of chunks in the correction V2 buffer.",
238 ParameterScope::Replica,
239);
240
241pub const ENABLE_COMPUTE_TEMPORAL_BUCKETING: Config<bool> = Config::new(
243 "enable_compute_temporal_bucketing",
244 false,
245 "Whether to enable temporal bucketing in compute.",
246 ParameterScope::Environment,
247);
248
249pub const TEMPORAL_BUCKETING_SUMMARY: Config<Duration> = Config::new(
251 "compute_temporal_bucketing_summary",
252 Duration::from_secs(2),
253 "The summary to apply to frontiers in temporal bucketing in compute.",
254 ParameterScope::Environment,
255);
256
257pub const LINEAR_JOIN_YIELDING: Config<&str> = Config::new(
259 "linear_join_yielding",
260 "work:1000000,time:100",
261 "The yielding behavior compute rendering should apply for linear join operators. Either \
262 'work:<amount>' or 'time:<milliseconds>' or 'work:<amount>,time:<milliseconds>'. Note \
263 that omitting one of 'work' or 'time' will entirely disable join yielding by time or \
264 work, respectively, rather than falling back to some default.",
265 ParameterScope::Replica,
266);
267
268pub const ENABLE_LGALLOC: Config<bool> = Config::new(
270 "enable_lgalloc",
271 true,
272 "Enable lgalloc.",
273 ParameterScope::Replica,
274);
275
276pub const ENABLE_LGALLOC_EAGER_RECLAMATION: Config<bool> = Config::new(
278 "enable_lgalloc_eager_reclamation",
279 true,
280 "Enable lgalloc's eager return behavior.",
281 ParameterScope::Replica,
282);
283
284pub const LGALLOC_BACKGROUND_INTERVAL: Config<Duration> = Config::new(
286 "lgalloc_background_interval",
287 Duration::from_secs(1),
288 "Scheduling interval for lgalloc's background worker.",
289 ParameterScope::Replica,
290);
291
292pub const LGALLOC_FILE_GROWTH_DAMPENER: Config<usize> = Config::new(
294 "lgalloc_file_growth_dampener",
295 2,
296 "Lgalloc's file growth dampener parameter.",
297 ParameterScope::Replica,
298);
299
300pub const LGALLOC_LOCAL_BUFFER_BYTES: Config<usize> = Config::new(
302 "lgalloc_local_buffer_bytes",
303 64 << 20,
304 "Lgalloc's local buffer bytes parameter.",
305 ParameterScope::Replica,
306);
307
308pub const LGALLOC_SLOW_CLEAR_BYTES: Config<usize> = Config::new(
310 "lgalloc_slow_clear_bytes",
311 128 << 20,
312 "Clear byte size per size class for every invocation",
313 ParameterScope::Replica,
314);
315
316pub const MEMORY_LIMITER_INTERVAL: Config<Duration> = Config::new(
318 "memory_limiter_interval",
319 Duration::from_secs(10),
320 "Interval to run the memory limiter. A zero duration disables the limiter.",
321 ParameterScope::Replica,
322);
323
324pub const MEMORY_LIMITER_USAGE_BIAS: Config<f64> = Config::new(
326 "memory_limiter_usage_bias",
327 1.,
328 "Multiplicative bias to the memory limiter's limit.",
329 ParameterScope::Replica,
330);
331
332pub const MEMORY_LIMITER_BURST_FACTOR: Config<f64> = Config::new(
334 "memory_limiter_burst_factor",
335 0.,
336 "Multiplicative burst factor to the memory limiter's limit.",
337 ParameterScope::Replica,
338);
339
340pub const ENABLE_COLUMNATION_LGALLOC: Config<bool> = Config::new(
342 "enable_columnation_lgalloc",
343 true,
344 "Enable allocating regions from lgalloc.",
345 ParameterScope::Replica,
346);
347
348pub const COMPUTE_SERVER_MAINTENANCE_INTERVAL: Config<Duration> = Config::new(
350 "compute_server_maintenance_interval",
351 Duration::from_millis(10),
352 "The interval at which the compute server performs maintenance tasks. Zero enables maintenance on every iteration.",
353 ParameterScope::Replica,
354);
355
356pub const DATAFLOW_MAX_INFLIGHT_BYTES: Config<Option<usize>> = Config::new(
358 "compute_dataflow_max_inflight_bytes",
359 None,
360 "The maximum number of in-flight bytes emitted by persist_sources feeding \
361 compute dataflows in non-cc clusters.",
362 ParameterScope::Replica,
363);
364
365pub const DATAFLOW_MAX_INFLIGHT_BYTES_CC: Config<Option<usize>> = Config::new(
370 "compute_dataflow_max_inflight_bytes_cc",
371 None,
372 "The maximum number of in-flight bytes emitted by persist_sources feeding \
373 compute dataflows in cc clusters.",
374 ParameterScope::Replica,
375);
376
377pub const CONSOLIDATING_VEC_GROWTH_DAMPENER: Config<usize> = Config::new(
380 "consolidating_vec_growth_dampener",
381 1,
382 "Dampener in growth rate for consolidating vector size",
383 ParameterScope::Replica,
384);
385
386pub const HYDRATION_CONCURRENCY: Config<usize> = Config::new(
394 "compute_hydration_concurrency",
395 4,
396 "Controls how many compute dataflows may hydrate concurrently.",
397 ParameterScope::Replica,
398);
399
400pub const COPY_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO: Config<usize> = Config::new(
402 "copy_to_s3_parquet_row_group_file_ratio",
403 20,
404 "The ratio (defined as a percentage) of row-group size to max-file-size. \
405 Must be <= 100.",
406 ParameterScope::Environment,
407);
408
409pub const COPY_TO_S3_ARROW_BUILDER_BUFFER_RATIO: Config<usize> = Config::new(
411 "copy_to_s3_arrow_builder_buffer_ratio",
412 150,
413 "The ratio (defined as a percentage) of arrow-builder size to row-group size. \
414 Must be >= 100.",
415 ParameterScope::Environment,
416);
417
418pub const COPY_TO_S3_MULTIPART_PART_SIZE_BYTES: Config<usize> = Config::new(
420 "copy_to_s3_multipart_part_size_bytes",
421 1024 * 1024 * 8,
422 "The size of each part in a multipart upload to S3.",
423 ParameterScope::Environment,
424);
425
426pub const ENABLE_COMPUTE_REPLICA_EXPIRATION: Config<bool> = Config::new(
434 "enable_compute_replica_expiration",
435 true,
436 "Main switch to disable replica expiration.",
437 ParameterScope::Environment,
438);
439
440pub const COMPUTE_REPLICA_EXPIRATION_OFFSET: Config<Duration> = Config::new(
446 "compute_replica_expiration_offset",
447 Duration::ZERO,
448 "The expiration time offset for replicas. Zero disables expiration.",
449 ParameterScope::Replica,
450);
451
452pub const COMPUTE_APPLY_COLUMN_DEMANDS: Config<bool> = Config::new(
456 "compute_apply_column_demands",
457 true,
458 "When enabled, passes applys column demands to the RelationDesc used to read out of Persist.",
459 ParameterScope::Environment,
460);
461
462pub const COMPUTE_FLAT_MAP_FUEL: Config<usize> = Config::new(
465 "compute_flat_map_fuel",
466 1_000_000,
467 "The amount of output the flat-map operator produces before yielding.",
468 ParameterScope::Replica,
469);
470
471pub const ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION: Config<bool> = Config::new(
473 "enable_compute_render_fueled_as_specific_collection",
474 true,
475 "When enabled, renders `as_specific_collection` using a fueled flat-map operator.",
476 ParameterScope::Environment,
477);
478
479pub const ENABLE_COMPUTE_LOGICAL_BACKPRESSURE: Config<bool> = Config::new(
481 "enable_compute_logical_backpressure",
482 false,
483 "When enabled, compute dataflows will apply logical backpressure.",
484 ParameterScope::Replica,
485);
486
487pub const COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES: Config<Option<usize>> =
496 Config::new(
497 "compute_logical_backpressure_max_retained_capabilities",
498 Some(30 * 24 * 60),
499 "The maximum number of capabilities retained by the logical backpressure operator.",
500 ParameterScope::Replica,
501 );
502
503pub const COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK: Config<Duration> = Config::new(
508 "compute_logical_backpressure_inflight_slack",
509 Duration::from_secs(1),
510 "Round observed timestamps to slack.",
511 ParameterScope::Replica,
512);
513
514pub const ENABLE_ARRANGEMENT_DICTIONARY_COMPRESSION_ALPHA: Config<bool> = Config::new(
523 "enable_arrangement_dictionary_compression_alpha",
524 true,
525 "Enable arrangement dictionary compression (alpha; not yet production-ready).",
526 ParameterScope::Replica,
527);
528
529pub const ENABLE_PEEK_RESPONSE_STASH: Config<bool> = Config::new(
533 "enable_compute_peek_response_stash",
534 true,
535 "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.",
536 ParameterScope::Environment,
537);
538
539pub const PEEK_RESPONSE_STASH_THRESHOLD_BYTES: Config<usize> = Config::new(
543 "compute_peek_response_stash_threshold_bytes",
544 1024 * 10, "The threshold above which to use the peek response stash, for sending back large peek responses.",
546 ParameterScope::Environment,
547);
548
549pub const PEEK_RESPONSE_STASH_BATCH_MAX_RUNS: Config<usize> = Config::new(
556 "compute_peek_response_stash_batch_max_runs",
557 2,
560 "The target number of maximum runs in the batches written to the stash.",
561 ParameterScope::Environment,
562);
563
564pub const PEEK_RESPONSE_STASH_READ_BATCH_SIZE_BYTES: Config<usize> = Config::new(
566 "compute_peek_response_stash_read_batch_size_bytes",
567 1024 * 1024 * 100, "The target size for batches of rows we read out of the peek stash.",
569 ParameterScope::Environment,
570);
571
572pub const PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES: Config<usize> = Config::new(
575 "compute_peek_response_stash_read_memory_budget_bytes",
576 1024 * 1024 * 64, "The memory budget for consolidating stashed peek responses in environmentd.",
578 ParameterScope::Environment,
579);
580
581pub const PEEK_STASH_NUM_BATCHES: Config<usize> = Config::new(
583 "compute_peek_stash_num_batches",
584 100,
585 "The number of batches to pump from the peek result iterator (in one iteration through the worker loop) when stashing peek responses.",
586 ParameterScope::Environment,
587);
588
589pub const PEEK_STASH_BATCH_SIZE: Config<usize> = Config::new(
592 "compute_peek_stash_batch_size",
593 100000,
594 "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.",
595 ParameterScope::Environment,
596);
597
598pub const COMPUTE_PROMETHEUS_INTROSPECTION_SCRAPE_INTERVAL: Config<Duration> = Config::new(
602 "compute_prometheus_introspection_scrape_interval",
603 Duration::from_secs(10),
604 "The collection interval for the Prometheus metrics introspection source. Set to zero to disable.",
605 ParameterScope::Replica,
606);
607
608pub const SUBSCRIBE_SNAPSHOT_OPTIMIZATION: Config<bool> = Config::new(
620 "compute_subscribe_snapshot_optimization",
621 true,
622 "If set, skip fetching or processing the snapshot data for subscribes when possible.",
623 ParameterScope::Environment,
624);
625
626pub const MV_SINK_ADVANCE_PERSIST_FRONTIERS: Config<bool> = Config::new(
630 "compute_mv_sink_advance_persist_frontiers",
631 true,
632 "Whether the MV sink's write operator advances its internal persist frontiers to the as_of.",
633 ParameterScope::Environment,
634);
635
636pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
638 configs
639 .add(&ENABLE_HALF_JOIN2)
640 .add(&ENABLE_ERROR_DISTINCT)
641 .add(&ENABLE_MZ_JOIN_CORE)
642 .add(&ENABLE_SYNC_MV_SINK)
643 .add(&ENABLE_CORRECTION_V2)
644 .add(&CORRECTION_V2_CHAIN_PROPORTIONALITY)
645 .add(&CORRECTION_V2_CHUNK_SIZE)
646 .add(&ENABLE_COMPUTE_TEMPORAL_BUCKETING)
647 .add(&TEMPORAL_BUCKETING_SUMMARY)
648 .add(&LINEAR_JOIN_YIELDING)
649 .add(&ENABLE_LGALLOC)
650 .add(&LGALLOC_BACKGROUND_INTERVAL)
651 .add(&LGALLOC_FILE_GROWTH_DAMPENER)
652 .add(&LGALLOC_LOCAL_BUFFER_BYTES)
653 .add(&LGALLOC_SLOW_CLEAR_BYTES)
654 .add(&MEMORY_LIMITER_INTERVAL)
655 .add(&MEMORY_LIMITER_USAGE_BIAS)
656 .add(&MEMORY_LIMITER_BURST_FACTOR)
657 .add(&ENABLE_LGALLOC_EAGER_RECLAMATION)
658 .add(&ENABLE_COLUMNATION_LGALLOC)
659 .add(&COMPUTE_SERVER_MAINTENANCE_INTERVAL)
660 .add(&DATAFLOW_MAX_INFLIGHT_BYTES)
661 .add(&DATAFLOW_MAX_INFLIGHT_BYTES_CC)
662 .add(&HYDRATION_CONCURRENCY)
663 .add(©_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO)
664 .add(©_TO_S3_ARROW_BUILDER_BUFFER_RATIO)
665 .add(©_TO_S3_MULTIPART_PART_SIZE_BYTES)
666 .add(&ENABLE_COMPUTE_REPLICA_EXPIRATION)
667 .add(&COMPUTE_REPLICA_EXPIRATION_OFFSET)
668 .add(&COMPUTE_APPLY_COLUMN_DEMANDS)
669 .add(&COMPUTE_FLAT_MAP_FUEL)
670 .add(&CONSOLIDATING_VEC_GROWTH_DAMPENER)
671 .add(&ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION)
672 .add(&ENABLE_COMPUTE_LOGICAL_BACKPRESSURE)
673 .add(&COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES)
674 .add(&COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK)
675 .add(&ENABLE_ARRANGEMENT_DICTIONARY_COMPRESSION_ALPHA)
676 .add(&ENABLE_PEEK_RESPONSE_STASH)
677 .add(&PEEK_RESPONSE_STASH_THRESHOLD_BYTES)
678 .add(&PEEK_RESPONSE_STASH_BATCH_MAX_RUNS)
679 .add(&PEEK_RESPONSE_STASH_READ_BATCH_SIZE_BYTES)
680 .add(&PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES)
681 .add(&PEEK_STASH_NUM_BATCHES)
682 .add(&PEEK_STASH_BATCH_SIZE)
683 .add(&COMPUTE_PROMETHEUS_INTROSPECTION_SCRAPE_INTERVAL)
684 .add(&SUBSCRIBE_SNAPSHOT_OPTIMIZATION)
685 .add(&MV_SINK_ADVANCE_PERSIST_FRONTIERS)
686 .add(&ENABLE_COLUMN_PAGED_BATCHER)
687 .add(&ENABLE_COLUMN_PAGED_BATCHER_SPILL)
688 .add(&COLUMN_PAGED_BATCHER_BUDGET_FRACTION)
689 .add(&COLUMN_PAGED_BATCHER_LZ4)
690 .add(&COLUMN_PAGED_BATCHER_SWAP_PAGEOUT)
691 .add(&COLUMN_PAGED_BATCHER_SPILL_WORKER_COUNT)
692 .add(&COLUMN_PAGED_BATCHER_EAGER_BACKING)
693 .add(&COLUMN_PAGED_BATCHER_POOL_RSS_TARGET_FRACTION)
694}