Skip to content

Commit

Permalink
Set default effective_io_concurrency and random_page_cost to SSD values
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pnorman committed Sep 12, 2023
1 parent 1e31662 commit 4018bab
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 19 deletions.
4 changes: 2 additions & 2 deletions cookbooks/postgresql/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions roles/eddie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
5 changes: 2 additions & 3 deletions roles/karm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

}
}
},
Expand Down
1 change: 0 additions & 1 deletion roles/prometheus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions roles/snap-01.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
4 changes: 1 addition & 3 deletions roles/snap-02.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
4 changes: 1 addition & 3 deletions roles/snap-03.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
1 change: 0 additions & 1 deletion roles/tile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4018bab

Please sign in to comment.