@cryptotaxi247 / infra / commits / 2d0ff7e8

haumea: Convert services.postgresql.extraConfig -> services.postgresql.settings

Eelco Dolstra committed Oct 17, 2020 at 20:10 UTC 2d0ff7e859eb546ebaac232286464ef90ef1ee71
1 file changed +22 -24
delft/haumea.nix
+22 -24
@@ -86,43 +86,41 @@
86 enable = true;
87 package = pkgs.postgresql_11;
88 # https://pgtune.leopard.in.ua/#/
89 - extraConfig = ''
90 - listen_addresses = '10.254.1.9'
91 - max_connections = 50
89 + settings = {
90 + listen_addresses = lib.mkForce "10.254.1.9";
91
93 - effective_cache_size = 48GB
94 - checkpoint_completion_target = 0.9
95 - default_statistics_target = 100
92 + checkpoint_completion_target = "0.9";
93 + default_statistics_target = 100;
94
97 - log_min_duration_statement = 5000
98 - log_duration = off
99 - log_statement = 'none'
100 - max_connections = 250
101 - work_mem = 20MB
102 - maintenance_work_mem = 2GB
95 + log_min_duration_statement = 5000;
96 + log_duration = "off";
97 + log_statement = "none";
98 + max_connections = 250;
99 + work_mem = "20MB";
100 + maintenance_work_mem = "2GB";
101
102 # 25% of memory
105 - shared_buffers = 16GB
103 + shared_buffers = "16GB";
104
105 # Checkpoint every 1GB. (default)
106 # increased after seeing many warninsg about frequent checkpoints
109 - min_wal_size = 1GB
110 - max_wal_size = 2GB
111 - wal_buffers = 16MB
107 + min_wal_size = "1GB";
108 + max_wal_size = "2GB";
109 + wal_buffers = "16MB";
110
113 - max_worker_processes = 16
114 - max_parallel_workers_per_gather = 8
115 - max_parallel_workers = 16
111 + max_worker_processes = 16;
112 + max_parallel_workers_per_gather = 8;
113 + max_parallel_workers = 16;
114
115 # NVMe related performance tuning
118 - effective_io_concurrency = 200
119 - random_page_cost = 1.1
116 + effective_io_concurrency = 200;
117 + random_page_cost = "1.1";
118
119 # We can risk losing some transactions.
122 - synchronous_commit = off
120 + synchronous_commit = "off";
121
124 - effective_cache_size = 16GB
125 - '';
122 + effective_cache_size = "16GB";
123 + };
124
125 # FIXME: don't use 'trust'.
126 authentication = ''