Skip to content

docs(storage): document storage.rocks.* memory config options#496

Draft
kriszyp wants to merge 2 commits into
mainfrom
docs/rocks-memory-config
Draft

docs(storage): document storage.rocks.* memory config options#496
kriszyp wants to merge 2 commits into
mainfrom
docs/rocks-memory-config

Conversation

@kriszyp
Copy link
Copy Markdown
Member

@kriszyp kriszyp commented May 26, 2026

Documents four new storage configuration parameters being added in v5.1.0 (source: HarperFast/harper#780).

What's added

reference/configuration/options.md — four new bullets under the existing storage section:

  • rocks.blockCacheSize
  • rocks.writeBufferManagerSize
  • rocks.writeBufferManagerCostToCache
  • rocks.writeBufferManagerAllowStall

reference/database/storage-tuning.md — a new "RocksDB Memory" detail section between "Read & Write Behavior" and "Storage Reclamation":

  • Intro framing the section as RocksDB-specific (no effect under `lmdb`)
  • A subsection on how RocksDB reads are cached — laying out the three-tier hierarchy (block cache → OS page cache → disk) with concrete latency expectations, so operators understand why a smaller block cache isn't necessarily worse on memory-constrained hosts
  • Per-param entries following the established `Type:` / `Default:` / prose / `yaml` block pattern
  • Practical guidance: when to lower the block cache vs. when to enable the WriteBufferManager
  • Explicit note that the block cache does not shrink on idle — important for operators reasoning about long-running deployments
  • Soft cap vs. hard cap (`allowStall: true`) trade-off

Scope decision

This PR is intentionally general guidance for any RocksDB deployment. The Fabric-specific multi-tenant tuning rationale (why we picked 15% block cache + 5% WBM in host-manager, the canopy memory data, the dependency chain across the three implementation PRs) is captured in host-manager's DESIGN.md rather than the public docs, since it's our infrastructure concern rather than something operators of self-hosted Harper need to reason about.

Where to focus review

  • Accuracy of the cache-hierarchy description and latency claims (1 µs / 5-20 µs / 100 µs-10 ms tiers) — these align with empirical testing on the rocksdb-js binding side (HarperFast/rocksdb-js#584).
  • Accuracy of the cost-to-cache description: pinned WBM charges show up in `block-cache-usage` but LRU cannot evict them, so the cache cannot "shrink" to make room for writes — verified in the rocksdb-js tests in #584.
  • Tone: matches the existing storage-tuning.md voice (problem-first, parameter description folded into guidance). Happy to restructure if a different shape is preferred.
  • Version annotation uses `<VersionBadge version="v5.1.0" />` per the existing convention in `replication/`.

What's NOT changed

  • No release notes entry — that would live in `release-notes/v5.1.0.md` once that file exists.
  • No changes to v4 docs in `reference_versioned_docs/version-v4/` (these options are v5+ only).

Build / format

  • `npm run format:write` — clean
  • `npm run build` — clean (the one broken-anchor warning is pre-existing in `resources/resource-api.md` referencing `javascript-environment#transaction`, unrelated)

Generated by Claude. — Claude Sonnet 4.7

Adds documentation for four new storage configuration parameters
introduced in v5.1.0:

- storage.rocks.blockCacheSize — explicit override for the shared
  RocksDB block cache size
- storage.rocks.writeBufferManagerSize — process-wide cap on
  memtable memory across all databases
- storage.rocks.writeBufferManagerCostToCache — share memtable
  accounting with the block cache for unified observability
- storage.rocks.writeBufferManagerAllowStall — hard cap vs soft
  cap behavior when the WriteBufferManager limit is reached

- Adds bullet-list entries to reference/configuration/options.md
  under the existing `storage` section.
- Adds a new "RocksDB Memory" detail section to
  reference/database/storage-tuning.md between "Read & Write
  Behavior" and "Storage Reclamation", with workload-recipe-style
  guidance for when to lower the cache or enable the manager.

Documents the multi-tenant shared-host scenario as the primary use
case for tuning these knobs.

Source PR: HarperFast/harper#780

Co-Authored-By: Claude Sonnet 4.7 <noreply@anthropic.com>
@kriszyp kriszyp requested review from Ethan-Arrowood, cb1kenobi and dawsontoth and removed request for dawsontoth May 26, 2026 13:20
@github-actions github-actions Bot temporarily deployed to pr-496 May 26, 2026 13:22 Inactive
@github-actions
Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-496

This preview will update automatically when you push new commits.

Reframes the RocksDB Memory section to focus on general memory
management rather than Fabric-specific multi-tenant tuning (that
context now lives in host-manager's DESIGN.md, where the actual
tuning decision is made).

Adds a new "How RocksDB reads are cached" subsection explaining
the three-tier hierarchy:

  block cache -> OS page cache -> disk

with concrete latency expectations and the implication for sizing:
shrinking the block cache shifts hits from the decompressed in-process
cache to the kernel's dynamically-sized compressed page cache, not
directly to disk. This helps operators reason about why a smaller
block cache isn't necessarily worse on memory-constrained hosts.

Drops the "shared-host / multi-tenant" framing from the section
intro and from the blockCacheSize discussion. Softens the
WriteBufferManager rationale to talk about "many tables" generically
rather than naming a 14-table customer profile.

Co-Authored-By: Claude Sonnet 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-496

This preview will update automatically when you push new commits.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant