From 5bad5bb56ed2d6160d421490c02e91ed0f4b8fa4 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Tue, 26 Dec 2023 10:42:17 +0300 Subject: [PATCH] Optimize PostgreSQL parameters for SSD storage Adjust default PostgreSQL configuration parameters to enhance performance on SSD storage. Key changes include reducing 'random_page_cost' to 1.1 to reflect the faster random access of SSDs and increasing 'effective_io_concurrency' to 200 to utilize the higher I/O parallelism of SSDs. --- vars/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/main.yml b/vars/main.yml index 57d6a9a9e..581e32db6 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -202,8 +202,8 @@ postgresql_parameters: - { option: "wal_buffers", value: "32MB" } - { option: "default_statistics_target", value: "1000" } - { option: "seq_page_cost", value: "1" } - - { option: "random_page_cost", value: "4" } # "1.1" for SSD storage. Also, if your databases fits in shared_buffers - - { option: "effective_io_concurrency", value: "2" } # "200" for SSD storage + - { option: "random_page_cost", value: "1.1" } # or "4" for HDDs with slower random access + - { option: "effective_io_concurrency", value: "200" } # or "2" for traditional HDDs with lower I/O parallelism - { option: "synchronous_commit", value: "on" } # or 'off' if you can you lose single transactions in case of a crash - { option: "autovacuum", value: "on" } # never turn off the autovacuum! - { option: "autovacuum_max_workers", value: "5" }