summary refs log tree commit diff
path: root/host/Rory-nginx/services/postgres.nix
diff options
context:
space:
mode:
Diffstat (limited to 'host/Rory-nginx/services/postgres.nix')
-rwxr-xr-xhost/Rory-nginx/services/postgres.nix24
1 files changed, 12 insertions, 12 deletions
diff --git a/host/Rory-nginx/services/postgres.nix b/host/Rory-nginx/services/postgres.nix
index fcfbc65..3545a31 100755
--- a/host/Rory-nginx/services/postgres.nix
+++ b/host/Rory-nginx/services/postgres.nix
@@ -24,15 +24,15 @@
     dataDir = "/mnt/postgres/data";
     settings = {
       # https://pgconfigurator.cybertec.at/
-      max_connections = 100;
+      max_connections = 250;
       superuser_reserved_connections = 3;
 
-      shared_buffers = "8192MB";
-      work_mem = "64MB";
-      maintenance_work_mem = "420MB";
+      shared_buffers = "32565MB";
+      work_mem = "512MB";
+      maintenance_work_mem = "1024MB";
       huge_pages = "try";
-      effective_cache_size = "22GB";
-      effective_io_concurrency = "1";
+      effective_cache_size = "60GB"; #was 22
+      effective_io_concurrency = "8";
       random_page_cost = 4;
 
       # can use this to view stats: SELECT query, total_time, calls, rows FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;
@@ -44,7 +44,7 @@
 
       wal_level = "replica";
       max_wal_senders = 0;
-      synchronous_commit = "on";
+      synchronous_commit = "off"; #was on
 
       checkpoint_timeout = "15min";
       checkpoint_completion_target = "0.9";
@@ -63,10 +63,10 @@
       bgwriter_lru_multiplier = "2.0";
       bgwriter_flush_after = "0";
 
-      max_worker_processes = "14";
-      max_parallel_workers_per_gather = "7";
-      max_parallel_maintenance_workers = "7";
-      max_parallel_workers = "14";
+      max_worker_processes = "32"; #was 14
+      max_parallel_workers_per_gather = "16"; #was 7
+      max_parallel_maintenance_workers = "16"; #was 7
+      max_parallel_workers = "32"; #was 14
       parallel_leader_participation = "on";
 
       enable_partitionwise_join = "on";
@@ -74,7 +74,7 @@
       jit = "on";
       max_slot_wal_keep_size = "1GB";
       track_wal_io_timing = "on";
-      maintenance_io_concurrency = "1";
+      maintenance_io_concurrency = "4";
       wal_recycle = "on";
 
     };