Skip to content

DEPLOY: tell Bridge what to do about memory, and what not to - #74

Open
emooreatx wants to merge 1 commit into
mainfrom
docs/bridge-memory-runbook
Open

DEPLOY: tell Bridge what to do about memory, and what not to#74
emooreatx wants to merge 1 commit into
mainfrom
docs/bridge-memory-runbook

Conversation

@emooreatx

Copy link
Copy Markdown
Contributor

Docs only. Three questions the ansible role now has to answer, none of which were written down anywhere it looks.

Don't set MALLOC_ARENA_MAX in compose. 0.3.63 caps arenas in the binary before the runtime is built, which keeps §2's zero-env contract intact — the one knob this process needs is not a CIRIS env var — and puts the setting somewhere a stack redeploy or a new host can't quietly drop it. An explicit value in the environment still wins, and the boot log says which path ran, so it's checkable rather than assumed.

Size mem_limit from a measurement, not from history. The 1.5 GB on the US node was sized against an uncapped process holding ~1.46 GB committed — of which ~1.4 GB was allocator free-list and 44 MB was live. Capped, the same work settles near 611 MB. The runbook now gives the two commands rather than a number that will be wrong the next time something changes: /api/v1/debug/memory for the allocator's own accounting, and the cgroup's memory.events for whether the limit is being enforced continuously. Headroom reclaimed here isn't free money — it's headroom ciris-server needs on the same host.

Don't copy the cap to ciris-server. Same pathology, different composition: its largest single region is a ~706 MB brk [heap] that an arena cap does not consolidate (CIRISServer#551). Better said here than discovered by someone trying it and finding a third of the win.

🤖 Generated with Claude Code

https://claude.ai/code/session_012B5ebRpgmkqskVYLZ7DH67

Three questions the ansible role now has to answer, none of which were written
down anywhere it looks.

**Don't set MALLOC_ARENA_MAX in compose.** 0.3.63 caps arenas in the binary
before the runtime is built, which keeps §2's zero-env contract intact — the one
knob this process needs is not a CIRIS env var — and puts the setting where it
cannot be lost by a stack redeploy or a new host. An explicit value still wins,
and the boot log says which path ran, so it is checkable rather than assumed.

**Size mem_limit from a measurement.** The 1.5GB on the US node was sized
against an uncapped process holding ~1.46GB committed, of which ~1.4GB was
allocator free-list and 44MB was live. Capped, the same work settles near
611MB. The runbook now gives the two commands — /api/v1/debug/memory for the
allocator's own accounting, and the cgroup's memory.events for whether the limit
is being enforced continuously — rather than a number that will be wrong the
next time something changes.

**Don't copy the cap to ciris-server.** Same pathology, different composition:
its largest region is a ~706MB brk heap that an arena cap does not consolidate
(CIRISServer#551). Better to say so here than to have someone try it and find a
third of the win.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012B5ebRpgmkqskVYLZ7DH67
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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