Skip to content

docs: load-test evidence for the nano Postgres memory settings#99

Draft
tonychang04 wants to merge 1 commit into
mainfrom
docs/pg-memory-tuning-evidence
Draft

docs: load-test evidence for the nano Postgres memory settings#99
tonychang04 wants to merge 1 commit into
mainfrom
docs/pg-memory-tuning-evidence

Conversation

@tonychang04

@tonychang04 tonychang04 commented Jul 15, 2026

Copy link
Copy Markdown
Member

What

Adds docs/pg-memory-loadtest-2026-07.md: A/B pgbench evidence (moderate load, heavy load, 90-connection storm, combined DB+vacuum+API stress) showing why the shipped docker-init/db/postgresql.conf memory settings exist.

Key result

On a 512MB nano host, stock Postgres defaults inside the ~150MB container limit get OOM-killed under a 90-connection storm (DB restart, 11 TPS, 6s avg latency, hung clients), while the shipped tuned conf fails fast and stays healthy (excess connections rejected, memory bounded, API on the same host still serving). Under heavy-but-legal load the tuned conf gives +8% TPS, half the swap traffic, and ~2x host headroom.

Also documents that the conf is bind-mounted from the host at provision time — hosts provisioned before the tuning landed need a re-copy + postgres restart to pick it up — and lists follow-up candidates (API image exec npm start double-wrapper, vm.swappiness on zram hosts, userland-proxy).

🤖 Generated with Claude Code

https://claude.ai/code/session_01J9NtiFkU34HQQgRSffNb4k


Summary by cubic

Adds docs/pg-memory-loadtest-2026-07.md with load-test evidence for the tuned Postgres memory settings on nano hosts. Shows that the shipped docker-init/db/postgresql.conf avoids OOM under a 90-connection storm and delivers ~8% higher TPS with less swap on 512MB instances.

  • Migration
    • If a host was provisioned before the tuning, re-copy the current postgresql.conf to the bind-mounted path and restart the Postgres container to apply it.

Written for commit 3ad4347. Summary will update on new commits.

Review in cubic

A/B pgbench test on a 512MB nano host: stock Postgres defaults inside the
~150MB container limit get OOM-killed under a 90-connection storm (DB
restart, 11 TPS, 6s latency) while the shipped tuned postgresql.conf fails
fast and stays healthy. Documents why the settings exist and reminds
operators that the bind-mounted conf on already-provisioned hosts needs a
re-copy + postgres restart to pick up tuning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J9NtiFkU34HQQgRSffNb4k
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 58668970-a5f3-4cc0-a1d8-3dd09f61bd3d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/pg-memory-tuning-evidence

Comment @coderabbitai help to get the list of available commands.

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