Repository navigation
fix: give postgresql 1g of shared memory - #14451
Conversation
Docker caps /dev/shm at 64 MB, which Postgres 18 outgrows on larger instances. It then fails crash recovery with 'could not resize shared memory segment: No space left on device', and the update installer times out waiting for Appwrite.
|
Review complete. No issues found. This PR increases PostgreSQL shared memory by adding a
Reviewed commit: e0894b0 |
🟢 Tier S · Ready to merge
The PostgreSQL service now has a 1 GiB shared-memory limit in the primary Compose configuration, and the docs compose data includes the same setting. The compose-data generator now emits multiline values as readable template literals and formats its output with the Console's Prettier configuration. 1 of 2 changed files was too large to include in full. Latest changes: The newest commits update the compose-data generator to serialize multiline values as escaped template literals and run Prettier on the generated TypeScript.
Note Part of the diff was too large to review, so Hansi did not approve. 📂 Walkthrough · 3
Reviewed the commits since |
The generator wrote every YAML block as one escaped JSON string, so the file had 7,000-character lines and diffs were unreadable. Multi-line strings are now template literals, and the output is run through Prettier. Every exported value is unchanged.
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
What does this PR do?
Adds
shm_size: 1gto thepostgresqlservice indocker-compose.yml. The installer and the docs compose generator both render from that file, so new installs and updates pick it up. The docscomposeData.tsis regenerated to match.Why
Docker gives each container only 64 MB of
/dev/shmby default. On larger self-hosted instances, Postgres 18 needs more than that for dynamic shared memory and fails during startup:Because Postgres never comes up, the
appwritecontainer never becomes healthy, and the 2.5.0 update installer fails with "Failed to connect with Appwrite in time. Could not resolve host: appwrite"./dev/shmis a tmpfs, so 1g is a ceiling, not a reservation. It only uses memory that Postgres actually writes.Test plan
docker compose config -qpassesbun run scripts/generate-compose-data.tsWorkaround for affected users: add
shm_size: 1gunderpostgresql:in~/appwrite/docker-compose.yml, then rundocker compose up -d.Related: #14424