Skip to content

Commit 0d2f0d7

Browse files
authored
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
1 parent 17ba4c8 commit 0d2f0d7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,17 @@ test-postgres-docker:
127127
--env POSTGRES_USER=postgres \
128128
--env POSTGRES_DB=postgres \
129129
--env PGDATA=/tmp \
130+
--tmpfs /tmp \
130131
--publish 5432:5432 \
131132
--name test-postgres-docker \
132-
--restart unless-stopped \
133+
--restart no \
133134
--detach \
134135
postgres:11 \
135136
-c shared_buffers=1GB \
136-
-c max_connections=1000
137+
-c max_connections=1000 \
138+
-c fsync=off \
139+
-c synchronous_commit=off \
140+
-c full_page_writes=off
137141

138142
.PHONY: test-clean
139143
test-clean:

0 commit comments

Comments
 (0)