From 6e0f5c504216039ada760d0bb014df3770e50054 Mon Sep 17 00:00:00 2001 From: jeremyhi Date: Tue, 7 Apr 2026 17:37:03 -0700 Subject: [PATCH] chore: memory limit comment (#7914) * chore: memory limit comment Signed-off-by: jeremyhi * chore: by gemini comment Signed-off-by: jeremyhi --------- Signed-off-by: jeremyhi --- config/config.md | 4 ++-- config/datanode.example.toml | 4 +++- config/standalone.example.toml | 4 +++- src/mito2/src/config.rs | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/config/config.md b/config/config.md index f28d09e28d..fb683eaaea 100644 --- a/config/config.md +++ b/config/config.md @@ -139,7 +139,7 @@ | `region_engine.mito.max_background_flushes` | Integer | Auto | Max number of running background flush jobs (default: 1/2 of cpu cores). | | `region_engine.mito.max_background_compactions` | Integer | Auto | Max number of running background compaction jobs (default: 1/4 of cpu cores). | | `region_engine.mito.max_background_purges` | Integer | Auto | Max number of running background purge jobs (default: number of cpu cores). | -| `region_engine.mito.experimental_compaction_memory_limit` | String | 0 | Memory budget for compaction tasks. Setting it to 0 or "unlimited" disables the limit. | +| `region_engine.mito.experimental_compaction_memory_limit` | String | 0 | Memory budget for compaction tasks.
Supports absolute size (e.g., "2GiB", "512MB") or percentage of system memory (e.g., "50%").
Setting it to 0 or "unlimited" disables the limit. | | `region_engine.mito.experimental_compaction_on_exhausted` | String | wait | Behavior when compaction cannot acquire memory from the budget.
Options: "wait" (default, 10s), "wait()", "fail" | | `region_engine.mito.auto_flush_interval` | String | `1h` | Interval to auto flush a region if it has not flushed yet. | | `region_engine.mito.global_write_buffer_size` | String | Auto | Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. | @@ -531,7 +531,7 @@ | `region_engine.mito.max_background_flushes` | Integer | Auto | Max number of running background flush jobs (default: 1/2 of cpu cores). | | `region_engine.mito.max_background_compactions` | Integer | Auto | Max number of running background compaction jobs (default: 1/4 of cpu cores). | | `region_engine.mito.max_background_purges` | Integer | Auto | Max number of running background purge jobs (default: number of cpu cores). | -| `region_engine.mito.experimental_compaction_memory_limit` | String | 0 | Memory budget for compaction tasks. Setting it to 0 or "unlimited" disables the limit. | +| `region_engine.mito.experimental_compaction_memory_limit` | String | 0 | Memory budget for compaction tasks.
Supports absolute size (e.g., "2GiB", "512MB") or percentage of system memory (e.g., "50%").
Setting it to 0 or "unlimited" disables the limit. | | `region_engine.mito.experimental_compaction_on_exhausted` | String | wait | Behavior when compaction cannot acquire memory from the budget.
Options: "wait" (default, 10s), "wait()", "fail" | | `region_engine.mito.auto_flush_interval` | String | `1h` | Interval to auto flush a region if it has not flushed yet. | | `region_engine.mito.global_write_buffer_size` | String | Auto | Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. | diff --git a/config/datanode.example.toml b/config/datanode.example.toml index 10e6965b84..6effec4c87 100644 --- a/config/datanode.example.toml +++ b/config/datanode.example.toml @@ -446,7 +446,9 @@ compress_manifest = false ## @toml2docs:none-default="Auto" #+ max_background_purges = 8 -## Memory budget for compaction tasks. Setting it to 0 or "unlimited" disables the limit. +## Memory budget for compaction tasks. +## Supports absolute size (e.g., "2GiB", "512MB") or percentage of system memory (e.g., "50%"). +## Setting it to 0 or "unlimited" disables the limit. ## @toml2docs:none-default="0" #+ experimental_compaction_memory_limit = "0" diff --git a/config/standalone.example.toml b/config/standalone.example.toml index 486bc74af2..7c7faa8a8b 100644 --- a/config/standalone.example.toml +++ b/config/standalone.example.toml @@ -538,7 +538,9 @@ compress_manifest = false ## @toml2docs:none-default="Auto" #+ max_background_purges = 8 -## Memory budget for compaction tasks. Setting it to 0 or "unlimited" disables the limit. +## Memory budget for compaction tasks. +## Supports absolute size (e.g., "2GiB", "512MB") or percentage of system memory (e.g., "50%"). +## Setting it to 0 or "unlimited" disables the limit. ## @toml2docs:none-default="0" #+ experimental_compaction_memory_limit = "0" diff --git a/src/mito2/src/config.rs b/src/mito2/src/config.rs index b3ddb023cb..120b5adbe3 100644 --- a/src/mito2/src/config.rs +++ b/src/mito2/src/config.rs @@ -91,7 +91,9 @@ pub struct MitoConfig { pub max_background_compactions: usize, /// Max number of running background purge jobs (default: number of cpu cores). pub max_background_purges: usize, - /// Memory budget for compaction tasks. Setting it to 0 or "unlimited" disables the limit. + /// Memory budget for compaction tasks. + /// Supports absolute size (e.g., "2GiB", "512MB") or percentage of system memory (e.g., "50%"). + /// Setting it to 0 or "unlimited" disables the limit. pub experimental_compaction_memory_limit: MemoryLimit, /// Behavior when compaction cannot acquire memory from the budget. pub experimental_compaction_on_exhausted: OnExhaustedPolicy,