Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

postgresql: Default random_page_cost to 1.1.

Alex Vandiver85d50d09d45e
diff --git a/docs/production/system-configuration.md b/docs/production/system-configuration.md
index 28c4f8fb164..2157436b779 100644
--- a/docs/production/system-configuration.md
+++ b/docs/production/system-configuration.md
@@ -236,7 +236,10 @@ setting](https://www.postgresql.org/docs/current/runtime-config-connection.html#
#### `random_page_cost`
Override PostgreSQL's [`random_page_cost`
-setting](https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-RANDOM-PAGE-COST)
+setting](https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-RANDOM-PAGE-COST).
+Zulip defaults this value to 1.1, which is an appropriate value for
+SSDs; if your server uses spinning disks, you should set this back to
+the upstream default of 4.0.
#### `replication_primary`
diff --git a/puppet/zulip/manifests/profile/postgresql.pp b/puppet/zulip/manifests/profile/postgresql.pp
index b288c1f6800..1303e8ded82 100644
--- a/puppet/zulip/manifests/profile/postgresql.pp
+++ b/puppet/zulip/manifests/profile/postgresql.pp
@@ -23,7 +23,7 @@ class zulip::profile::postgresql(Boolean $start = true) {
$wal_buffers = zulipconf('postgresql', 'wal_buffers', undef)
$min_wal_size = zulipconf('postgresql', 'min_wal_size', undef)
$max_wal_size = zulipconf('postgresql', 'max_wal_size', undef)
- $random_page_cost = zulipconf('postgresql', 'random_page_cost', undef)
+ $random_page_cost = zulipconf('postgresql', 'random_page_cost', '1.1')
$effective_io_concurrency = zulipconf('postgresql', 'effective_io_concurrency', undef)
$listen_addresses = zulipconf('postgresql', 'listen_addresses', undef)