chore: apply non-durability settings to test postgres container (#2479)

This commit applies some recommended settings to sacrifice durability
for speed for our testing database:
  - Mount PGDATA dir on a tmpfs (--tmpfs /tmp)
  - Turn off fsync
  - Turn off synchronous_commit
  - Turn off full_page_writes

  Ref: https://www.postgresql.org/docs/current/non-durability.html
This commit is contained in:
Cian Johnston 2022-06-17 20:57:38 +01:00 committed by GitHub
parent 17ba4c8e88
commit 0d2f0d7f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -127,13 +127,17 @@ test-postgres-docker:
--env POSTGRES_USER=postgres \
--env POSTGRES_DB=postgres \
--env PGDATA=/tmp \
--tmpfs /tmp \
--publish 5432:5432 \
--name test-postgres-docker \
--restart unless-stopped \
--restart no \
--detach \
postgres:11 \
-c shared_buffers=1GB \
-c max_connections=1000
-c max_connections=1000 \
-c fsync=off \
-c synchronous_commit=off \
-c full_page_writes=off
.PHONY: test-clean
test-clean: