From f7a58aea47967e3f93d9cdcff44fe9d4f8500d52 Mon Sep 17 00:00:00 2001 From: johnstcn Date: Fri, 17 Jun 2022 18:52:40 +0000 Subject: [PATCH] chore: apply non-durability settings to test postgres container 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 2fd940cb6f13b..111d56a11d7c9 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: