diff --git a/Makefile.toml b/Makefile.toml index 7bbdac7b1335..403213cc0b0b 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1070,3 +1070,14 @@ set -e cp -a .risingwave/rw-docker/* docker ''' + +[tasks.generate-example-config] +category = "misc" +description = "Generate default config and write to src/config/example.toml" +script = ''' +cat << EOF > src/config/example.toml +# This file is generated by ./risedev generate-example-config +# Check detailed comments in src/common/src/config.rs +EOF +cargo run --bin example-config >> src/config/example.toml +''' diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml index 19155a90145d..d56683ad464e 100644 --- a/src/common/Cargo.toml +++ b/src/common/Cargo.toml @@ -115,3 +115,7 @@ harness = false [[bench]] name = "bench_hash_key_encoding" harness = false + +[[bin]] +name = "example-config" +path = "src/bin/default_config.rs" diff --git a/src/common/src/bin/default_config.rs b/src/common/src/bin/default_config.rs new file mode 100644 index 000000000000..98f66854d2d0 --- /dev/null +++ b/src/common/src/bin/default_config.rs @@ -0,0 +1,21 @@ +// Copyright 2023 RisingWave Labs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use risingwave_common::config::RwConfig; + +fn main() { + let config = RwConfig::default(); + let toml = toml::to_string(&config).unwrap(); + print!("{}", &toml); +} diff --git a/src/config/example.toml b/src/config/example.toml index b8e25ff93276..b6c20b15faa4 100644 --- a/src/config/example.toml +++ b/src/config/example.toml @@ -1,45 +1,87 @@ +# This file is generated by ./risedev generate-example-config +# Check detailed comments in src/common/src/config.rs [server] heartbeat_interval_ms = 1000 max_heartbeat_interval_secs = 600 connection_pool_size = 16 +metrics_level = 0 +telemetry_enabled = true [meta] +min_sst_retention_time_sec = 604800 +collect_gc_watermark_spin_interval_sec = 5 +periodic_compaction_interval_sec = 60 +vacuum_interval_sec = 30 +max_heartbeat_interval_secs = 300 +disable_recovery = false +meta_leader_lease_secs = 10 +enable_compaction_deterministic = false +enable_committed_sst_sanity_check = false +node_num_monitor_interval_sec = 10 +backend = "Mem" +periodic_space_reclaim_compaction_interval_sec = 3600 +periodic_ttl_reclaim_compaction_interval_sec = 1800 +max_compactor_task_multiplier = 2 -[batch] +[batch.developer] +batch_output_channel_size = 64 +batch_chunk_size = 1024 +stream_enable_executor_row_count = false +stream_connector_message_buffer_size = 16 +unsafe_stream_extreme_cache_size = 1024 +stream_chunk_size = 1024 +stream_exchange_initial_permits = 8192 +stream_exchange_batched_permits = 1024 [streaming] -barrier_interval_ms = 1000 -in_flight_barrier_nums = 10 -checkpoint_frequency = 10 +in_flight_barrier_nums = 10000 +enable_jaeger_tracing = false +async_stack_trace = "On" +unique_user_stream_errors = 10 + +[streaming.developer] +batch_output_channel_size = 64 +batch_chunk_size = 1024 +stream_enable_executor_row_count = false +stream_connector_message_buffer_size = 16 +unsafe_stream_extreme_cache_size = 1024 +stream_chunk_size = 1024 +stream_exchange_initial_permits = 8192 +stream_exchange_batched_permits = 1024 [storage] -shared_buffer_capacity_mb = 4096 -block_cache_capacity_mb = 4096 -meta_cache_capacity_mb = 1024 -compactor_memory_limit_mb = 5120 +share_buffers_sync_parallelism = 1 +share_buffer_compaction_worker_threads_number = 4 +shared_buffer_capacity_mb = 1024 +write_conflict_detection_enabled = true +block_cache_capacity_mb = 512 +meta_cache_capacity_mb = 128 +disable_remote_compactor = false +enable_local_spill = true +local_object_store = "tempdisk" +share_buffer_upload_concurrency = 8 +compactor_memory_limit_mb = 512 +sstable_id_remote_fetch_number = 10 +min_sst_size_for_streaming_upload = 33554432 +max_sub_compaction = 4 +max_concurrent_compaction_task_number = 16 [storage.file_cache] +dir = "" capacity_mb = 1024 total_buffer_capacity_mb = 128 cache_file_fallocate_unit_mb = 512 cache_meta_fallocate_unit_mb = 16 cache_file_max_write_size_mb = 4 -#The configurable parameters in [XXX.developer] subsection are for developers. -#Users are not encouraged to tune or depend on the following parameters. -#Some configurable parameters exist only temporarily. -[batch.developer] -batch_output_channel_size = 64 -batch_chunk_size = 1024 - -[streaming.developer] -stream_enable_executor_row_count = false -stream_connector_message_buffer_size = 16 -unsafe_stream_extreme_cache_size = 1024 -stream_chunk_size = 1024 - [system] +barrier_interval_ms = 1000 +checkpoint_frequency = 10 sstable_size_mb = 256 -block_size_kb = 1024 +block_size_kb = 64 bloom_false_positive = 0.001 -data_directory = "hummock_001" \ No newline at end of file +state_store = "" +data_directory = "hummock_001" +backup_storage_url = "memory" +backup_storage_directory = "backup" +telemetry_enabled = true