mirror of
https://github.com/element-hq/synapse.git
synced 2026-09-01 18:08:30 +00:00
Fix tmpfs mount for predictability
This commit is contained in:
@@ -382,14 +382,17 @@ jobs:
|
||||
- name: Set up PostgreSQL ${{ matrix.job.postgres-version }}
|
||||
if: ${{ matrix.job.postgres-version }}
|
||||
# 1. Mount postgres data files onto a tmpfs in-memory filesystem to reduce overhead of docker's overlayfs layer.
|
||||
# Use a custom path to ensure stability (it will change across versions,
|
||||
# see https://github.com/docker-library/postgres/blob/be0b7ac960bb393b00a31938b6d878397f482759/Dockerfile-debian.template#L188)
|
||||
# 2. Expose the unix socket for postgres. This removes latency of using docker-proxy for connections.
|
||||
# 3. We disable crash-safety features for speed: fsync, synchronous commits, full-page writes.
|
||||
# Note: synchronous commits are enabled/disabled at runtime by Synapse, so there is also
|
||||
# code in `tests/server.py` to configure this as off.
|
||||
run: |
|
||||
docker run -d -p 5432:5432 \
|
||||
--tmpfs /var/lib/postgresql:rw,size=6144m \
|
||||
--tmpfs /pgdata:rw,size=6144m \
|
||||
--mount 'type=bind,src=/var/run/postgresql,dst=/var/run/postgresql' \
|
||||
-e PGDATA=/pgdata \
|
||||
-e POSTGRES_PASSWORD=postgres \
|
||||
-e POSTGRES_INITDB_ARGS="--lc-collate C --lc-ctype C --encoding UTF8" \
|
||||
postgres:${{ matrix.job.postgres-version }} \
|
||||
|
||||
Reference in New Issue
Block a user