From f6478bc90911975ee542567ec440ef04f4fc9875 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 17 Jun 2024 02:06:20 +0200 Subject: [PATCH 1/2] haumea/postgresql: use jit package JIT was previously enabled in the configuration, but the package did not have support for it. --- delft/haumea/postgresql.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/delft/haumea/postgresql.nix b/delft/haumea/postgresql.nix index 5b1b770b..08cc6eef 100644 --- a/delft/haumea/postgresql.nix +++ b/delft/haumea/postgresql.nix @@ -20,6 +20,7 @@ services.postgresql = { enable = true; + enableJIT = true; package = pkgs.postgresql_16; dataDir = "/var/db/postgresql/16"; # https://pgtune.leopard.in.ua/#/ From 6137463fb5267c4e946acb312b70cc038e1afc94 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 17 Jun 2024 02:06:33 +0200 Subject: [PATCH 2/2] haumea/postgresql: disable full page writes "ZFS does not need full page writes to prevent torn pages, because ZFS never tears pages" --- delft/haumea/postgresql.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/delft/haumea/postgresql.nix b/delft/haumea/postgresql.nix index 08cc6eef..0c4acb8c 100644 --- a/delft/haumea/postgresql.nix +++ b/delft/haumea/postgresql.nix @@ -28,6 +28,9 @@ settings = { listen_addresses = lib.mkForce "10.254.1.9"; + # https://vadosware.io/post/everything-ive-seen-on-optimizing-postgres-on-zfs-on-linux/#zfs-related-tunables-on-the-postgres-side + full_page_writes = "off"; + checkpoint_completion_target = "0.9"; default_statistics_target = 100;