summary refs log tree commit diff
path: root/host/Rory-nginx/services/postgres.nix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-02-05 14:04:44 +0100
committerRory& <root@rory.gay>2024-02-05 14:04:44 +0100
commit98768a3c592475aac0db405cf460bf0cc961e0b8 (patch)
tree6ae6bf2e05d810e324d5ef09f7e222cef990342e /host/Rory-nginx/services/postgres.nix
parentUpdate from server (diff)
downloadRory-Open-Architecture-98768a3c592475aac0db405cf460bf0cc961e0b8.tar.xz
Postgres buffering, maybe?
Diffstat (limited to 'host/Rory-nginx/services/postgres.nix')
-rwxr-xr-xhost/Rory-nginx/services/postgres.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/host/Rory-nginx/services/postgres.nix b/host/Rory-nginx/services/postgres.nix
index 26ceed7..8912542 100755
--- a/host/Rory-nginx/services/postgres.nix
+++ b/host/Rory-nginx/services/postgres.nix
@@ -24,9 +24,24 @@
     dataDir = "/mnt/postgres/data";
     settings = {
       "max_connections" = "100";
-      "shared_buffers" = "128MB";
+      "shared_buffers" = "512MB";
+      "effective_cache_size" = "8192MB";
       "max_wal_size" = "1GB";
       "min_wal_size" = "80MB";
+      "work_mem" = "16MB";
+      "maintenance_work_mem" = "256MB";
+      "checkpoint_segments" = "64";
+      "default_statistics_target" = "250";
+
+      # can use this to view stats: SELECT query, total_time, calls, rows FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;
+      "shared_preload_libraries" = "pg_stat_statements";
+      "pg_stat_statements.max" = "10000";
+      "pg_stat_statements.track" = "all";
+
+      #we're on virtualised HDDs... 
+      "random_page_cost" = "2.0";
+      "synchronous_commit" = "off";
+
     };
   };