My Nix Configuration
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[marvin] update postgres settings for new NVMe database

dish fcc0a421 9ffb35d3

+11 -27
+11 -27
hosts/marvin/services/postgres.nix
··· 8 8 package = pkgs.postgresql_16; 9 9 enableJIT = true; 10 10 # Settings taken from [PGTune](https://pgtune.leopard.in.ua/) 11 + # https://pgtune.leopard.in.ua/?dbVersion=16&osType=linux&dbType=mixed&cpuNum&totalMemory=16&totalMemoryUnit=GB&connectionNum&hdType=ssd 11 12 settings = { 13 + # PGTune Settings 12 14 max_connections = "300"; 13 - shared_buffers = "2GB"; 14 - effective_cache_size = "6GB"; 15 - maintenance_work_mem = "512MB"; 15 + shared_buffers = "4GB"; 16 + effective_cache_size = "12GB"; 17 + maintenance_work_mem = "1GB"; 16 18 checkpoint_completion_target = 0.9; 17 19 wal_buffers = "16MB"; 18 20 default_statistics_target = 100; 19 - random_page_cost = 4; 20 - effective_io_concurrency = 2; 21 - work_mem = "2621kB"; 21 + random_page_cost = 1.1; 22 + effective_io_concurrency = 200; 23 + work_mem = "19418kB"; 22 24 huge_pages = "off"; 23 25 min_wal_size = "1GB"; 24 26 max_wal_size = "4GB"; 25 - max_worker_processes = 8; 27 + 28 + max_worker_processes = 16; 29 + max_parallel_workers = 16; 26 30 max_parallel_workers_per_gather = 4; 27 - max_parallel_workers = 8; 28 31 max_parallel_maintenance_workers = 4; 29 32 }; 30 33 }; 31 - # systemd.timers.pg-autovacuum = { 32 - # description = "Timer for Postgres Autovacuum"; 33 - # timerConfig = { 34 - # OnCalendar = "*-*-* 01:00:00"; 35 - # Unit = "pg-autovacuum.service"; 36 - # }; 37 - # }; 38 - # systemd.services.pg-autovacuum = { 39 - # description = "Vacuum all Postgres databases."; 40 - # requisite = [ "postgresql.service" ]; 41 - # wantedBy = [ "multi-user.target" ]; 42 - # serviceConfig = { 43 - # Type = "oneshot"; 44 - # User = "postgres"; 45 - # Group = "postgres"; 46 - # SyslogIdentifier = "pg-autovacuum"; 47 - # ExecStart = "${cfg.package}/bin/vacuumdb --all --echo --jobs=6 --parallel=5 --analyze --verbose"; 48 - # }; 49 - # }; 50 34 }