Set GOMEMLIMIT in the image and document the memory budget (closes #13)
check / check (push) Failing after 1s

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
This commit was merged in pull request #22.
This commit is contained in:
2026-09-21 17:29:29 +02:00
parent efaf79c4e3
commit 658aadbb81
2 changed files with 43 additions and 1 deletions
+5
View File
@@ -78,6 +78,11 @@ RUN chown -R routewatch:routewatch /app
ENV XDG_DATA_HOME=/var/lib
# Cap the Go heap at 1.5 GiB so the runtime collects harder before the
# container's memory limit is reached. runuser preserves this the way it does
# XDG_DATA_HOME above.
ENV GOMEMLIMIT=1536MiB
# Expose HTTP port
EXPOSE 8080