Skip to content

Tier RAM budget by host size#752

Merged
DeusData merged 1 commit into
DeusData:mainfrom
Andy11-cpu:fix/ram-tier-budget
Jul 4, 2026
Merged

Tier RAM budget by host size#752
DeusData merged 1 commit into
DeusData:mainfrom
Andy11-cpu:fix/ram-tier-budget

Conversation

@Andy11-cpu

Copy link
Copy Markdown
Contributor

Summary

  • Use 25% of physical RAM on hosts with <=16GB, 35% on <=32GB, and 50% above
  • Add cbm_mem_ram_fraction_for_total() with unit tests

Motivation

Split from #625 — reduces default memory reservation on 16GB machines without changing indexing behavior.

Test plan

  • mem_ram_fraction_* tier tests in test_mem.c
  • make -f Makefile.cbm test (CI)

Signed-off-by: Andy11-cpu canada11@duck.com

Use 25% of physical RAM on hosts with 16GB or less, 35% on 32GB or less, and 50% above. Expose cbm_mem_ram_fraction_for_total() for unit tests and call it from MCP/CLI startup instead of a fixed 50% fraction.

Signed-off-by: Andy11-cpu <canada11@duck.com>
@Andy11-cpu Andy11-cpu requested a review from DeusData as a code owner July 2, 2026 01:56
@DeusData DeusData added stability/performance Server crashes, OOM, hangs, high CPU/memory priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Jul 3, 2026
@DeusData

DeusData commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Thanks for the RAM-budget split. Triage: high-priority stability/performance work from the memory-pressure track.

Review will check that the tiered default is conservative on 16GB machines, does not regress larger-host throughput unexpectedly, and composes correctly with explicit memory-budget overrides. Please keep any benchmark or before/after memory observations in the PR description as it evolves.

@DeusData

DeusData commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Quick status note: this PR is one of four open memory/RAM-policy changes (#833, #752, #586, #685) that we've reviewed individually and found genuinely complementary — so rather than merging them piecemeal, we're doing a combined design pass over the whole memory policy (explicit override, host-tiered defaults, retention bounds, post-index release, and the Windows auto-sync driver in #841) and will respond here with a concrete direction shortly. Your work is very much part of that plan — thanks for your patience!

@DeusData DeusData added the bug Something isn't working label Jul 4, 2026
@DeusData DeusData merged commit a960d3d into DeusData:main Jul 4, 2026
14 checks passed
@DeusData

DeusData commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Thank you — this is a clean, well-judged fix: tiering the RAM fraction by host size (25% ≤16GB / 35% ≤32GB / 50% above) so small and containerized hosts don't over-commit, and it correctly reads the cgroup-aware total so a memory-limited container gets the right tier. Atomic, green on all platforms, with genuine boundary tests. Merged as a960d3d. It composes cleanly with the CBM_MEM_BUDGET_MB explicit override (override still wins) and the retention layer's re-read fallback covers the smaller-budget case with no lost edges. Appreciated — and thanks for splitting this out from the earlier bundle so it could land on its own merits!

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

Labels

bug Something isn't working priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. stability/performance Server crashes, OOM, hangs, high CPU/memory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants