Skip to content

docs: add per-region write buffer docs (write_buffer_size, default_region_write_buffer_size) - #2639

Merged
v0y4g3r merged 4 commits into
mainfrom
codex/github-mention-update-docs-for-feat-support-per-region-wri-lpjvgf
Jul 24, 2026
Merged

docs: add per-region write buffer docs (write_buffer_size, default_region_write_buffer_size)#2639
v0y4g3r merged 4 commits into
mainfrom
codex/github-mention-update-docs-for-feat-support-per-region-wri-lpjvgf

Conversation

@evenyag

@evenyag evenyag commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Document a new per-region write-buffer feature so operators understand how to limit memtable usage per region and protect hot regions.
  • Clarify precedence and interaction between table-level limits and the Mito engine defaults to avoid operator misconfiguration.

Description

  • Add a write_buffer_size table option to CREATE TABLE and ALTER TABLE docs with SET/UNSET examples.
  • Document the configured value as the per-region stall threshold: GreptimeDB schedules a flush at half the value, stalls writes at the value, and rejects writes at twice the value.
  • Distinguish an explicit table value of 0, which disables the per-region limit, from UNSET, which falls back to default_region_write_buffer_size.
  • Add default_region_write_buffer_size to the region_engine.mito example and option table, and update the performance-tuning guidance for hot-region protection.
  • Apply these changes only to the nightly English and Chinese docs. The feature is not available in v1.1, so versioned_docs/version-1.1 remains unchanged.

Testing

  • Ran git diff --check successfully.
  • Ran typos on all eight modified Markdown files successfully.
  • Verified there is no explicit-zero SQL example and the existing UNSET 'write_buffer_size' example remains.
  • Verified that versioned_docs/version-1.1 has no changes in this PR.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploying greptime-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3af2efa
Status: ✅  Deploy successful!
Preview URL: https://64fc03f6.greptime-docs.pages.dev
Branch Preview URL: https://codex-github-mention-update-o3z3.greptime-docs.pages.dev

View logs

Comment thread docs/reference/sql/create.md Outdated
evenyag added 2 commits July 21, 2026 17:24
Signed-off-by: evenyag <realevenyag@gmail.com>
Signed-off-by: evenyag <realevenyag@gmail.com>
Comment thread docs/user-guide/deployments-administration/configuration.md Outdated
Comment thread docs/reference/sql/alter.md Outdated
Signed-off-by: evenyag <realevenyag@gmail.com>

@fengjiachun fengjiachun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En part LGTM

@evenyag
evenyag marked this pull request as ready for review July 24, 2026 09:13
@evenyag
evenyag requested a review from killme2008 as a code owner July 24, 2026 09:13
@v0y4g3r
v0y4g3r merged commit bd8a450 into main Jul 24, 2026
6 checks passed
@v0y4g3r
v0y4g3r deleted the codex/github-mention-update-docs-for-feat-support-per-region-wri-lpjvgf branch July 24, 2026 09:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3af2efa296

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


In most cases, leave `region_engine.mito.global_write_buffer_reject_size` unset so GreptimeDB uses the default reject threshold of 2x `global_write_buffer_size`. If you need writes to fail earlier under memory pressure, set it manually to a deliberate margin, commonly 1.5x to 2x `global_write_buffer_size`, based on available datanode memory and how early you want requests to be rejected. The value must be greater than `global_write_buffer_size`; otherwise, GreptimeDB sanitizes it back to 2x.

For hot-region protection, configure a per-table `write_buffer_size` or set `region_engine.mito.default_region_write_buffer_size` as the cluster default. The effective value is the stall threshold: GreptimeDB schedules a flush when mutable memtable usage reaches half the value, stalls writes at the value, and rejects writes at twice the value, while other regions on the same worker can continue accepting writes. A table-level `write_buffer_size` takes precedence over the engine default. An explicit table value of `0` disables the per-region limit, while unsetting the table option falls back to the engine default. The default value of `default_region_write_buffer_size` is `0`, which disables default per-region limits.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mirror write-buffer limits in agent skills

In the AI-agent workflow, this new hot-region guidance is not picked up by the installable performance skills: skills/greptimedb-performance-tuning/SKILL.md still tells agents to address healthy write-buffer pressure by increasing only region_engine.mito.global_write_buffer_size, and skills/greptimedb-performance-diagnosis/SKILL.md still describes stalls/rejects only in terms of the global buffer. Because skills/README.md publishes those as GreptimeDB documentation for AI agents, users who follow the skills for write stalls can still be advised to raise the global buffer instead of setting write_buffer_size/default_region_write_buffer_size for hot regions.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants