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);
25
26pub const ENABLE_COLUMN_PAGED_BATCHER: Config<bool> = Config::new(
39 "enable_column_paged_batcher",
40 false,
41 "Use the columnar-native paged merge batcher at arrange sites. When `false` (default), \
42 arranges fall back to the legacy columnation `Col2ValBatcher` / `RowRowBuilder` path.",
43)
44.scoped(ParameterScope::Replica);
45
46pub const ENABLE_COLUMN_PAGED_BATCHER_SPILL: Config<bool> = Config::new(
61 "enable_column_paged_batcher_spill",
62 false,
63 "Allow the column-paged batcher's pager to evict chunks under memory pressure. Only \
64 meaningful when `enable_column_paged_batcher = true`.",
65)
66.scoped(ParameterScope::Replica);
67
68pub const COLUMN_PAGED_BATCHER_BUDGET_FRACTION: Config<f64> = Config::new(
83 "column_paged_batcher_budget_fraction",
84 0.05,
85 "Budget fraction for chunk spilling: the buffer pool multiplies it against physical \
86 RAM and the column pager's tiered policy against the announced memory limit. \
87 Total pool budget = max(ram * fraction, 128 MiB).",
88)
89.scoped(ParameterScope::Replica);
90
91pub const COLUMN_PAGED_BATCHER_SPILL_WORKER_COUNT: Config<usize> = Config::new(
99 "column_paged_batcher_spill_worker_count",
100 2,
101 "Buffer-pool spill threads for off-worker eviction I/O; 0 evicts inline on the caller.",
102)
103.scoped(ParameterScope::Replica);
104
105pub const COLUMN_PAGED_BATCHER_LZ4: Config<bool> = Config::new(
113 "column_paged_batcher_lz4",
114 false,
115 "Compress column-paged batcher chunks with lz4 on the spill path. Only meaningful when \
116 `enable_column_paged_batcher_spill = true`.",
117)
118.scoped(ParameterScope::Replica);
119
120pub const COLUMN_PAGED_BATCHER_SWAP_PAGEOUT: Config<bool> = Config::new(
135 "column_paged_batcher_swap_pageout",
136 false,
137 "Eagerly evict the column-paged batcher's lz4-compressed swap-backend spill chunks from RSS \
138 via `MADV_PAGEOUT` (they otherwise receive no madvise and are reclaimed only lazily). Only \
139 meaningful when `column_paged_batcher_lz4 = true` and the swap backend is active.",
140)
141.scoped(ParameterScope::Replica);
142
143pub const COLUMN_PAGED_BATCHER_EAGER_BACKING: Config<bool> = Config::new(
150 "column_paged_batcher_eager_backing",
151 false,
152 "Eagerly compress buffer-pool chunks to compressed-but-resident on idle spill threads, so \
153 budget-driven eviction is a pure page release. Only meaningful with spill workers.",
154)
155.scoped(ParameterScope::Replica);
156
157pub const COLUMN_PAGED_BATCHER_POOL_RSS_TARGET_FRACTION: Config<f64> = Config::new(
172 "column_paged_batcher_pool_rss_target_fraction",
173 0.25,
174 "Ceiling on the buffer pool's total RSS as a fraction of physical RAM; the headroom above \
175 the slot budget holds compressed-but-resident extents. Zero pages extents out immediately.",
176)
177.scoped(ParameterScope::Replica);
178
179pub const ENABLE_MZ_JOIN_CORE: Config<bool> = Config::new(
181 "enable_mz_join_core",
182 true,
183 "Whether compute should use `mz_join_core` rather than DD's `JoinCore::join_core` to render \
184 linear joins.",
185);
186
187pub const ENABLE_SYNC_MV_SINK: Config<bool> = Config::new(
189 "enable_compute_sync_mv_sink",
190 true,
191 "Use sync Timely operators with Tokio tasks for the MV sink.",
192);
193
194pub const ENABLE_CORRECTION_V2: Config<bool> = Config::new(
196 "enable_compute_correction_v2",
197 true,
198 "Whether compute should use the new MV sink correction buffer implementation.",
199);
200
201pub const CORRECTION_V2_CHAIN_PROPORTIONALITY: Config<f64> = Config::new(
203 "compute_correction_v2_chain_proportionality",
204 3.0,
205 "The size factor of subsequent chains in the correction V2 buffer.",
206);
207
208pub const CORRECTION_V2_CHUNK_SIZE: Config<usize> = Config::new(
210 "compute_correction_v2_chunk_size",
211 8 * 1024,
212 "The byte size of chunks in the correction V2 buffer.",
213);
214
215pub const ENABLE_COMPUTE_TEMPORAL_BUCKETING: Config<bool> = Config::new(
217 "enable_compute_temporal_bucketing",
218 false,
219 "Whether to enable temporal bucketing in compute.",
220);
221
222pub const TEMPORAL_BUCKETING_SUMMARY: Config<Duration> = Config::new(
224 "compute_temporal_bucketing_summary",
225 Duration::from_secs(2),
226 "The summary to apply to frontiers in temporal bucketing in compute.",
227);
228
229pub const LINEAR_JOIN_YIELDING: Config<&str> = Config::new(
231 "linear_join_yielding",
232 "work:1000000,time:100",
233 "The yielding behavior compute rendering should apply for linear join operators. Either \
234 'work:<amount>' or 'time:<milliseconds>' or 'work:<amount>,time:<milliseconds>'. Note \
235 that omitting one of 'work' or 'time' will entirely disable join yielding by time or \
236 work, respectively, rather than falling back to some default.",
237);
238
239pub const ENABLE_LGALLOC: Config<bool> =
241 Config::new("enable_lgalloc", true, "Enable lgalloc.").scoped(ParameterScope::Replica);
242
243pub const ENABLE_LGALLOC_EAGER_RECLAMATION: Config<bool> = Config::new(
245 "enable_lgalloc_eager_reclamation",
246 true,
247 "Enable lgalloc's eager return behavior.",
248);
249
250pub const LGALLOC_BACKGROUND_INTERVAL: Config<Duration> = Config::new(
252 "lgalloc_background_interval",
253 Duration::from_secs(1),
254 "Scheduling interval for lgalloc's background worker.",
255);
256
257pub const LGALLOC_FILE_GROWTH_DAMPENER: Config<usize> = Config::new(
259 "lgalloc_file_growth_dampener",
260 2,
261 "Lgalloc's file growth dampener parameter.",
262);
263
264pub const LGALLOC_LOCAL_BUFFER_BYTES: Config<usize> = Config::new(
266 "lgalloc_local_buffer_bytes",
267 64 << 20,
268 "Lgalloc's local buffer bytes parameter.",
269);
270
271pub const LGALLOC_SLOW_CLEAR_BYTES: Config<usize> = Config::new(
273 "lgalloc_slow_clear_bytes",
274 128 << 20,
275 "Clear byte size per size class for every invocation",
276);
277
278pub const MEMORY_LIMITER_INTERVAL: Config<Duration> = Config::new(
280 "memory_limiter_interval",
281 Duration::from_secs(10),
282 "Interval to run the memory limiter. A zero duration disables the limiter.",
283);
284
285pub const MEMORY_LIMITER_USAGE_BIAS: Config<f64> = Config::new(
287 "memory_limiter_usage_bias",
288 1.,
289 "Multiplicative bias to the memory limiter's limit.",
290);
291
292pub const MEMORY_LIMITER_BURST_FACTOR: Config<f64> = Config::new(
294 "memory_limiter_burst_factor",
295 0.,
296 "Multiplicative burst factor to the memory limiter's limit.",
297);
298
299pub const ENABLE_COLUMNATION_LGALLOC: Config<bool> = Config::new(
301 "enable_columnation_lgalloc",
302 true,
303 "Enable allocating regions from lgalloc.",
304);
305
306pub const COMPUTE_SERVER_MAINTENANCE_INTERVAL: Config<Duration> = Config::new(
308 "compute_server_maintenance_interval",
309 Duration::from_millis(10),
310 "The interval at which the compute server performs maintenance tasks. Zero enables maintenance on every iteration.",
311);
312
313pub const DATAFLOW_MAX_INFLIGHT_BYTES: Config<Option<usize>> = Config::new(
315 "compute_dataflow_max_inflight_bytes",
316 None,
317 "The maximum number of in-flight bytes emitted by persist_sources feeding \
318 compute dataflows in non-cc clusters.",
319);
320
321pub const DATAFLOW_MAX_INFLIGHT_BYTES_CC: Config<Option<usize>> = Config::new(
326 "compute_dataflow_max_inflight_bytes_cc",
327 None,
328 "The maximum number of in-flight bytes emitted by persist_sources feeding \
329 compute dataflows in cc clusters.",
330);
331
332pub const CONSOLIDATING_VEC_GROWTH_DAMPENER: Config<usize> = Config::new(
335 "consolidating_vec_growth_dampener",
336 1,
337 "Dampener in growth rate for consolidating vector size",
338);
339
340pub const HYDRATION_CONCURRENCY: Config<usize> = Config::new(
342 "compute_hydration_concurrency",
343 4,
344 "Controls how many compute dataflows may hydrate concurrently.",
345);
346
347pub const COPY_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO: Config<usize> = Config::new(
349 "copy_to_s3_parquet_row_group_file_ratio",
350 20,
351 "The ratio (defined as a percentage) of row-group size to max-file-size. \
352 Must be <= 100.",
353);
354
355pub const COPY_TO_S3_ARROW_BUILDER_BUFFER_RATIO: Config<usize> = Config::new(
357 "copy_to_s3_arrow_builder_buffer_ratio",
358 150,
359 "The ratio (defined as a percentage) of arrow-builder size to row-group size. \
360 Must be >= 100.",
361);
362
363pub const COPY_TO_S3_MULTIPART_PART_SIZE_BYTES: Config<usize> = Config::new(
365 "copy_to_s3_multipart_part_size_bytes",
366 1024 * 1024 * 8,
367 "The size of each part in a multipart upload to S3.",
368);
369
370pub const ENABLE_COMPUTE_REPLICA_EXPIRATION: Config<bool> = Config::new(
374 "enable_compute_replica_expiration",
375 true,
376 "Main switch to disable replica expiration.",
377);
378
379pub const COMPUTE_REPLICA_EXPIRATION_OFFSET: Config<Duration> = Config::new(
385 "compute_replica_expiration_offset",
386 Duration::ZERO,
387 "The expiration time offset for replicas. Zero disables expiration.",
388);
389
390pub const COMPUTE_APPLY_COLUMN_DEMANDS: Config<bool> = Config::new(
394 "compute_apply_column_demands",
395 true,
396 "When enabled, passes applys column demands to the RelationDesc used to read out of Persist.",
397);
398
399pub const COMPUTE_FLAT_MAP_FUEL: Config<usize> = Config::new(
402 "compute_flat_map_fuel",
403 1_000_000,
404 "The amount of output the flat-map operator produces before yielding.",
405);
406
407pub const ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION: Config<bool> = Config::new(
409 "enable_compute_render_fueled_as_specific_collection",
410 true,
411 "When enabled, renders `as_specific_collection` using a fueled flat-map operator.",
412);
413
414pub const ENABLE_COMPUTE_LOGICAL_BACKPRESSURE: Config<bool> = Config::new(
416 "enable_compute_logical_backpressure",
417 false,
418 "When enabled, compute dataflows will apply logical backpressure.",
419);
420
421pub const COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES: Config<Option<usize>> =
430 Config::new(
431 "compute_logical_backpressure_max_retained_capabilities",
432 Some(30 * 24 * 60),
433 "The maximum number of capabilities retained by the logical backpressure operator.",
434 );
435
436pub const COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK: Config<Duration> = Config::new(
441 "compute_logical_backpressure_inflight_slack",
442 Duration::from_secs(1),
443 "Round observed timestamps to slack.",
444);
445
446pub const ENABLE_ARRANGEMENT_DICTIONARY_COMPRESSION_ALPHA: Config<bool> = Config::new(
455 "enable_arrangement_dictionary_compression_alpha",
456 false,
457 "Enable arrangement dictionary compression (alpha; not yet production-ready).",
458);
459
460pub const ENABLE_PEEK_RESPONSE_STASH: Config<bool> = Config::new(
464 "enable_compute_peek_response_stash",
465 true,
466 "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.",
467);
468
469pub const PEEK_RESPONSE_STASH_THRESHOLD_BYTES: Config<usize> = Config::new(
473 "compute_peek_response_stash_threshold_bytes",
474 1024 * 10, "The threshold above which to use the peek response stash, for sending back large peek responses.",
476);
477
478pub const PEEK_RESPONSE_STASH_BATCH_MAX_RUNS: Config<usize> = Config::new(
485 "compute_peek_response_stash_batch_max_runs",
486 2,
489 "The target number of maximum runs in the batches written to the stash.",
490);
491
492pub const PEEK_RESPONSE_STASH_READ_BATCH_SIZE_BYTES: Config<usize> = Config::new(
494 "compute_peek_response_stash_read_batch_size_bytes",
495 1024 * 1024 * 100, "The target size for batches of rows we read out of the peek stash.",
497);
498
499pub const PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES: Config<usize> = Config::new(
502 "compute_peek_response_stash_read_memory_budget_bytes",
503 1024 * 1024 * 64, "The memory budget for consolidating stashed peek responses in environmentd.",
505);
506
507pub const PEEK_STASH_NUM_BATCHES: Config<usize> = Config::new(
509 "compute_peek_stash_num_batches",
510 100,
511 "The number of batches to pump from the peek result iterator (in one iteration through the worker loop) when stashing peek responses.",
512);
513
514pub const PEEK_STASH_BATCH_SIZE: Config<usize> = Config::new(
517 "compute_peek_stash_batch_size",
518 100000,
519 "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.",
520);
521
522pub const COMPUTE_PROMETHEUS_INTROSPECTION_SCRAPE_INTERVAL: Config<Duration> = Config::new(
526 "compute_prometheus_introspection_scrape_interval",
527 Duration::from_secs(10),
528 "The collection interval for the Prometheus metrics introspection source. Set to zero to disable.",
529);
530
531pub const SUBSCRIBE_SNAPSHOT_OPTIMIZATION: Config<bool> = Config::new(
533 "compute_subscribe_snapshot_optimization",
534 true,
535 "If set, skip fetching or processing the snapshot data for subscribes when possible.",
536);
537
538pub const MV_SINK_ADVANCE_PERSIST_FRONTIERS: Config<bool> = Config::new(
542 "compute_mv_sink_advance_persist_frontiers",
543 true,
544 "Whether the MV sink's write operator advances its internal persist frontiers to the as_of.",
545);
546
547pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
549 configs
550 .add(&ENABLE_HALF_JOIN2)
551 .add(&ENABLE_MZ_JOIN_CORE)
552 .add(&ENABLE_SYNC_MV_SINK)
553 .add(&ENABLE_CORRECTION_V2)
554 .add(&CORRECTION_V2_CHAIN_PROPORTIONALITY)
555 .add(&CORRECTION_V2_CHUNK_SIZE)
556 .add(&ENABLE_COMPUTE_TEMPORAL_BUCKETING)
557 .add(&TEMPORAL_BUCKETING_SUMMARY)
558 .add(&LINEAR_JOIN_YIELDING)
559 .add(&ENABLE_LGALLOC)
560 .add(&LGALLOC_BACKGROUND_INTERVAL)
561 .add(&LGALLOC_FILE_GROWTH_DAMPENER)
562 .add(&LGALLOC_LOCAL_BUFFER_BYTES)
563 .add(&LGALLOC_SLOW_CLEAR_BYTES)
564 .add(&MEMORY_LIMITER_INTERVAL)
565 .add(&MEMORY_LIMITER_USAGE_BIAS)
566 .add(&MEMORY_LIMITER_BURST_FACTOR)
567 .add(&ENABLE_LGALLOC_EAGER_RECLAMATION)
568 .add(&ENABLE_COLUMNATION_LGALLOC)
569 .add(&COMPUTE_SERVER_MAINTENANCE_INTERVAL)
570 .add(&DATAFLOW_MAX_INFLIGHT_BYTES)
571 .add(&DATAFLOW_MAX_INFLIGHT_BYTES_CC)
572 .add(&HYDRATION_CONCURRENCY)
573 .add(©_TO_S3_PARQUET_ROW_GROUP_FILE_RATIO)
574 .add(©_TO_S3_ARROW_BUILDER_BUFFER_RATIO)
575 .add(©_TO_S3_MULTIPART_PART_SIZE_BYTES)
576 .add(&ENABLE_COMPUTE_REPLICA_EXPIRATION)
577 .add(&COMPUTE_REPLICA_EXPIRATION_OFFSET)
578 .add(&COMPUTE_APPLY_COLUMN_DEMANDS)
579 .add(&COMPUTE_FLAT_MAP_FUEL)
580 .add(&CONSOLIDATING_VEC_GROWTH_DAMPENER)
581 .add(&ENABLE_COMPUTE_RENDER_FUELED_AS_SPECIFIC_COLLECTION)
582 .add(&ENABLE_COMPUTE_LOGICAL_BACKPRESSURE)
583 .add(&COMPUTE_LOGICAL_BACKPRESSURE_MAX_RETAINED_CAPABILITIES)
584 .add(&COMPUTE_LOGICAL_BACKPRESSURE_INFLIGHT_SLACK)
585 .add(&ENABLE_ARRANGEMENT_DICTIONARY_COMPRESSION_ALPHA)
586 .add(&ENABLE_PEEK_RESPONSE_STASH)
587 .add(&PEEK_RESPONSE_STASH_THRESHOLD_BYTES)
588 .add(&PEEK_RESPONSE_STASH_BATCH_MAX_RUNS)
589 .add(&PEEK_RESPONSE_STASH_READ_BATCH_SIZE_BYTES)
590 .add(&PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES)
591 .add(&PEEK_STASH_NUM_BATCHES)
592 .add(&PEEK_STASH_BATCH_SIZE)
593 .add(&COMPUTE_PROMETHEUS_INTROSPECTION_SCRAPE_INTERVAL)
594 .add(&SUBSCRIBE_SNAPSHOT_OPTIMIZATION)
595 .add(&MV_SINK_ADVANCE_PERSIST_FRONTIERS)
596 .add(&ENABLE_COLUMN_PAGED_BATCHER)
597 .add(&ENABLE_COLUMN_PAGED_BATCHER_SPILL)
598 .add(&COLUMN_PAGED_BATCHER_BUDGET_FRACTION)
599 .add(&COLUMN_PAGED_BATCHER_LZ4)
600 .add(&COLUMN_PAGED_BATCHER_SWAP_PAGEOUT)
601 .add(&COLUMN_PAGED_BATCHER_SPILL_WORKER_COUNT)
602 .add(&COLUMN_PAGED_BATCHER_EAGER_BACKING)
603 .add(&COLUMN_PAGED_BATCHER_POOL_RSS_TARGET_FRACTION)
604}