postgresql: tune for reduced memory usage

This commit is contained in:
2024-11-04 22:46:29 +00:00
parent be112ea232
commit f23f8e31ae

View File

@@ -50,22 +50,23 @@ in
# - for recommended values see: <https://pgtune.leopard.in.ua/> # - for recommended values see: <https://pgtune.leopard.in.ua/>
# - for official docs (sparse), see: <https://www.postgresql.org/docs/11/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE> # - for official docs (sparse), see: <https://www.postgresql.org/docs/11/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
services.postgresql.settings = { services.postgresql.settings = {
# DB Version: 15 # DB Version: 16
# OS Type: linux # OS Type: linux
# DB Type: web # DB Type: web
# Total Memory (RAM): 32 GB # vvv artificially constrained because the server's resources are shared across maaany services
# Total Memory (RAM): 12 GB
# CPUs num: 12 # CPUs num: 12
# Data Storage: ssd # Data Storage: ssd
max_connections = 200; max_connections = 200;
shared_buffers = "8GB"; shared_buffers = "3GB";
effective_cache_size = "24GB"; effective_cache_size = "9GB";
maintenance_work_mem = "2GB"; maintenance_work_mem = "768MB";
checkpoint_completion_target = 0.9; checkpoint_completion_target = 0.9;
wal_buffers = "16MB"; wal_buffers = "16MB";
default_statistics_target = 100; default_statistics_target = 100;
random_page_cost = 1.1; random_page_cost = 1.1;
effective_io_concurrency = 200; effective_io_concurrency = 200;
work_mem = "10485kB"; work_mem = "3932kB";
min_wal_size = "1GB"; min_wal_size = "1GB";
max_wal_size = "4GB"; max_wal_size = "4GB";
max_worker_processes = 12; max_worker_processes = 12;