summary refs log tree commit diff
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-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";
+
     };
   };