From 4018babfab45567a0036d60136ce4d7874c496bd Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Mon, 11 Sep 2023 14:27:05 -0700 Subject: [PATCH] Set default effective_io_concurrency and random_page_cost to SSD values Since all the drives with DBs on them are SSDs, set these GUCs to values more appropriate to a generic SSD. NVMe drives could have even higher concurrency, but this is a reasonable start. --- cookbooks/postgresql/attributes/default.rb | 4 ++-- roles/eddie.rb | 4 +--- roles/karm.rb | 5 ++--- roles/prometheus.rb | 1 - roles/snap-01.rb | 4 +--- roles/snap-02.rb | 4 +--- roles/snap-03.rb | 4 +--- roles/tile.rb | 1 - 8 files changed, 8 insertions(+), 19 deletions(-) diff --git a/cookbooks/postgresql/attributes/default.rb b/cookbooks/postgresql/attributes/default.rb index 878407aec..19d871ba1 100644 --- a/cookbooks/postgresql/attributes/default.rb +++ b/cookbooks/postgresql/attributes/default.rb @@ -9,7 +9,7 @@ default[:postgresql][:settings][:defaults][:work_mem] = "4MB" default[:postgresql][:settings][:defaults][:maintenance_work_mem] = "64MB" default[:postgresql][:settings][:defaults][:max_stack_depth] = "2MB" -default[:postgresql][:settings][:defaults][:effective_io_concurrency] = "1" +default[:postgresql][:settings][:defaults][:effective_io_concurrency] = "256" default[:postgresql][:settings][:defaults][:max_worker_processes] = "8" default[:postgresql][:settings][:defaults][:max_parallel_workers_per_gather] = "2" default[:postgresql][:settings][:defaults][:max_parallel_workers] = "8" @@ -30,7 +30,7 @@ default[:postgresql][:settings][:defaults][:hot_standby] = "on" default[:postgresql][:settings][:defaults][:hot_standby_feedback] = "off" default[:postgresql][:settings][:defaults][:seq_page_cost] = "1.0" -default[:postgresql][:settings][:defaults][:random_page_cost] = "4.0" +default[:postgresql][:settings][:defaults][:random_page_cost] = "1.1" default[:postgresql][:settings][:defaults][:cpu_tuple_cost] = "0.01" default[:postgresql][:settings][:defaults][:effective_cache_size] = "4GB" default[:postgresql][:settings][:defaults][:default_statistics_target] = "100" diff --git a/roles/eddie.rb b/roles/eddie.rb index 319be0b9d..61e452455 100644 --- a/roles/eddie.rb +++ b/roles/eddie.rb @@ -19,9 +19,7 @@ :shared_buffers => "64GB", :work_mem => "64MB", :maintenance_work_mem => "1GB", - :effective_cache_size => "180GB", - :effective_io_concurrency => "256", - :random_page_cost => "1.1" + :effective_cache_size => "180GB" } } }, diff --git a/roles/karm.rb b/roles/karm.rb index cc3a425b9..ac28c48d4 100644 --- a/roles/karm.rb +++ b/roles/karm.rb @@ -25,9 +25,8 @@ :shared_buffers => "64GB", :work_mem => "64MB", :maintenance_work_mem => "1GB", - :effective_cache_size => "180GB", - :effective_io_concurrency => "256", - :random_page_cost => "1.1" + :effective_cache_size => "180GB" + } } }, diff --git a/roles/prometheus.rb b/roles/prometheus.rb index 85a1f1829..8dfe36a87 100644 --- a/roles/prometheus.rb +++ b/roles/prometheus.rb @@ -9,7 +9,6 @@ :shared_buffers => "48GB", :work_mem => "8MB", :maintenance_work_mem => "2GB", - :effective_io_concurrency => "200", :max_worker_processes => "67", :max_parallel_workers_per_gather => "28", :max_parallel_workers => "56", diff --git a/roles/snap-01.rb b/roles/snap-01.rb index 15db38629..d7fb452a5 100644 --- a/roles/snap-01.rb +++ b/roles/snap-01.rb @@ -25,9 +25,7 @@ :shared_buffers => "128GB", :work_mem => "128MB", :maintenance_work_mem => "2GB", - :effective_cache_size => "360GB", - :effective_io_concurrency => "256", - :random_page_cost => "1.1" + :effective_cache_size => "360GB" } } }, diff --git a/roles/snap-02.rb b/roles/snap-02.rb index 8dc70a658..80a2b3598 100644 --- a/roles/snap-02.rb +++ b/roles/snap-02.rb @@ -19,9 +19,7 @@ :shared_buffers => "128GB", :work_mem => "128MB", :maintenance_work_mem => "2GB", - :effective_cache_size => "360GB", - :effective_io_concurrency => "256", - :random_page_cost => "1.1" + :effective_cache_size => "360GB" } } }, diff --git a/roles/snap-03.rb b/roles/snap-03.rb index 3bae5690c..749859eb1 100644 --- a/roles/snap-03.rb +++ b/roles/snap-03.rb @@ -25,9 +25,7 @@ :shared_buffers => "128GB", :work_mem => "128MB", :maintenance_work_mem => "2GB", - :effective_cache_size => "360GB", - :effective_io_concurrency => "256", - :random_page_cost => "1.1" + :effective_cache_size => "360GB" } } }, diff --git a/roles/tile.rb b/roles/tile.rb index 65c0a577c..6b159b568 100644 --- a/roles/tile.rb +++ b/roles/tile.rb @@ -46,7 +46,6 @@ :commit_delay => "10000", :max_wal_size => "2880MB", :max_wal_senders => "0", - :random_page_cost => "1.1", :jit => "off", :track_activity_query_size => "16384", :autovacuum_vacuum_scale_factor => "0.05",