Set GOMEMLIMIT in the image and document the memory budget (closes #13) #22

Merged
clawbot merged 1 commits from issue-13-gomemlimit-memory-docs into next 2026-09-21 17:29:30 +02:00
Collaborator

Closes #13 (U7 of the memory plan in #3).

Two changes; no code paths touched:

  • Dockerfile: ENV GOMEMLIMIT=1536MiB in the runtime stage, next to XDG_DATA_HOME. entrypoint.sh runs the daemon under runuser without --login, which preserves the environment, so no entrypoint change was needed.
  • README.md: a Memory section covering the budget, the required --memory=5g --memory-swap=5g container limit, how to override GOMEMLIMIT, what happens at each limit, and the DEBUG=routewatch System stats line.

I checked every sentence in the Memory section against the merged next tree: the SQLite 640 MiB pool cache and 1 GiB/1.5 GiB heap limits, the four 20,000-message queues and their drop-on-full behaviour, the batch-drop-on-error path, and the 60-second System stats debug line.

The authoritative gate is script/cibuild (the Docker build, make check with the pinned linter) run under the flock; the lint and test stages executed rather than cached. From a container started from the image without --memory (this host refuses that flag), the routewatch process (uid 1000) shows GOMEMLIMIT=1536MiB in its environment.

Judgement call: also added a GOMEMLIMIT row to the Configuration table so the override is documented in both places.

Model: opus-4-8

Closes https://git.eeqj.de/sneak/routewatch/issues/13 (U7 of the memory plan in https://git.eeqj.de/sneak/routewatch/issues/3). Two changes; no code paths touched: - `Dockerfile`: `ENV GOMEMLIMIT=1536MiB` in the runtime stage, next to `XDG_DATA_HOME`. `entrypoint.sh` runs the daemon under `runuser` without `--login`, which preserves the environment, so no entrypoint change was needed. - `README.md`: a Memory section covering the budget, the required `--memory=5g --memory-swap=5g` container limit, how to override `GOMEMLIMIT`, what happens at each limit, and the `DEBUG=routewatch` System stats line. I checked every sentence in the Memory section against the merged `next` tree: the SQLite 640 MiB pool cache and 1 GiB/1.5 GiB heap limits, the four 20,000-message queues and their drop-on-full behaviour, the batch-drop-on-error path, and the 60-second System stats debug line. The authoritative gate is `script/cibuild` (the Docker build, `make check` with the pinned linter) run under the flock; the lint and test stages executed rather than cached. From a container started from the image without `--memory` (this host refuses that flag), the `routewatch` process (uid 1000) shows `GOMEMLIMIT=1536MiB` in its environment. Judgement call: also added a `GOMEMLIMIT` row to the Configuration table so the override is documented in both places. Model: opus-4-8
clawbot added 1 commit 2026-09-21 16:39:17 +02:00
Add ENV GOMEMLIMIT=1536MiB to the runtime stage so the Go runtime keeps a
1.5 GiB soft heap limit. runuser preserves it the way it already does
XDG_DATA_HOME, so the routewatch process inherits it.

Add a Memory section to the README describing the budget (Go 1.5 GiB soft,
SQLite 640 MiB pool cache and 1.5 GiB hard heap, ~0.2 GiB other), the
required 5 GiB container limit, how to override GOMEMLIMIT, what happens at
each limit, and the DEBUG=routewatch System stats line. Every sentence
matches the behaviour already merged to next.

Model: opus-4-8
clawbot added the needs-review label 2026-09-21 16:39:26 +02:00
clawbot self-assigned this 2026-09-21 16:39:26 +02:00
Author
Collaborator

PASS — the Dockerfile sets ENV GOMEMLIMIT=1536MiB (confirmed present in the routewatch process environment of a container started from the image), and every sentence of the new README Memory section matches the merged next tree: the 640 MiB pool page cache (64 MiB × 10 connections), the 1 GiB soft / 1.5 GiB hard SQLite heap limits and their drop-a-batch-and-continue behaviour, the four 20,000-message queues that drop rather than block, the GOMEMLIMIT override, the --memory=5g --memory-swap=5g limit, and the DEBUG=routewatch System stats line every 60 s; the authoritative Docker gate is green with lint and tests executed fresh.

Model: opus-4-8

PASS — the `Dockerfile` sets `ENV GOMEMLIMIT=1536MiB` (confirmed present in the `routewatch` process environment of a container started from the image), and every sentence of the new README Memory section matches the merged `next` tree: the 640 MiB pool page cache (64 MiB × 10 connections), the 1 GiB soft / 1.5 GiB hard SQLite heap limits and their drop-a-batch-and-continue behaviour, the four 20,000-message queues that drop rather than block, the `GOMEMLIMIT` override, the `--memory=5g --memory-swap=5g` limit, and the `DEBUG=routewatch` `System stats` line every 60 s; the authoritative Docker gate is green with lint and tests executed fresh. Model: opus-4-8
clawbot removed the needs-review label 2026-09-21 17:22:11 +02:00
clawbot merged commit 658aadbb81 into next 2026-09-21 17:29:30 +02:00
clawbot deleted branch issue-13-gomemlimit-memory-docs 2026-09-21 17:29:30 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#22