Skip to content

go/libraries/doltcore/dbfactory: Add DOLT_MEMTABLE_SIZE env var for write buffer sizing - #10816

Closed
stebbins wants to merge 1 commit into
dolthub:mainfrom
skullbloc:do-qzs-memtable-size
Closed

stebbins wants to merge 1 commit into
dolthub:mainfrom
skullbloc:do-qzs-memtable-size

Conversation

@stebbins

@stebbins stebbins commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

The NBS memtable write buffer defaults to 256 MiB in dbfactory and is the second-largest fixed memory allocation in Dolt. This makes it configurable via the DOLT_MEMTABLE_SIZE environment variable.

For memory-constrained deployments, tuning this down reduces RSS. For write-heavy workloads on machines with ample RAM, tuning it up can reduce flush frequency.

No default behavior change — without the env var, memtable remains 256 MiB.

  • go/libraries/doltcore/dbfactory/factory.go — const defaultMemTableSize changed to var, init() reads env var
  • go/libraries/doltcore/dconfig/envvars.go — EnvMemTableSize constant

@stebbins stebbins changed the title Add DOLT_MEMTABLE_SIZE environment variable for write buffer configuration go/libraries/doltcore/dbfactory: Add DOLT_MEMTABLE_SIZE env var for write buffer sizing Apr 4, 2026
@stebbins
stebbins force-pushed the do-qzs-memtable-size branch from d9a6573 to 7647d0b Compare April 4, 2026 16:40

@reltuk reltuk 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.

Please see feedback on #10815. We're open to making these tunable, but I'm not sure I want an environment variable that directly sets its size.

@stebbins

stebbins commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

#10815 (comment)

closing in favor of #10820

@stebbins stebbins closed this Apr 7, 2026
@stebbins

stebbins commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

#10821

to make it easier since there are already a few PRs, i created an issue to track the concept

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants