From 0d2f0d7f8c2999786dbf4c3b6023832b34cf1a13 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Fri, 17 Jun 2022 20:57:38 +0100 Subject: [PATCH] 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 --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2fd940cb6f..111d56a11d 100644 --- a/Makefile +++ b/Makefile @@ -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: