From e7cdea1c4365be476dca1c689a080bdba4b91efb Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Wed, 17 Apr 2013 16:14:20 -0400 Subject: [PATCH] puppet: Tweak Postgres master tunables for its hardware (imported from commit 8644e82d00944203728a3214b2141f778e1c54ed) --- .../postgresql/30-postgresql-shm.conf.master | 4 +-- .../files/postgresql/postgresql.conf.master | 26 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/servers/puppet/modules/humbug/files/postgresql/30-postgresql-shm.conf.master b/servers/puppet/modules/humbug/files/postgresql/30-postgresql-shm.conf.master index 92062b609d..cec73b374e 100644 --- a/servers/puppet/modules/humbug/files/postgresql/30-postgresql-shm.conf.master +++ b/servers/puppet/modules/humbug/files/postgresql/30-postgresql-shm.conf.master @@ -9,5 +9,5 @@ # Maximum total size of shared memory in pages (normally 4096 bytes) #kernel.shmall = 2097152 -kernel.shmall = 1703936 -kernel.shmmax = 6979321856 +kernel.shmall = 6553600 +kernel.shmmax = 26843545600 diff --git a/servers/puppet/modules/humbug/files/postgresql/postgresql.conf.master b/servers/puppet/modules/humbug/files/postgresql/postgresql.conf.master index 53e70cea72..a76b9c30a9 100644 --- a/servers/puppet/modules/humbug/files/postgresql/postgresql.conf.master +++ b/servers/puppet/modules/humbug/files/postgresql/postgresql.conf.master @@ -554,18 +554,22 @@ default_text_search_config = 'pg_catalog.english' #------------------------------------------------------------------------------ #custom_variable_classes = '' # list of custom variable class names -maintenance_work_mem = 448MB # pgtune wizard 2012-12-12 -checkpoint_completion_target = 0.7 # pgtune wizard 2012-12-12 -effective_cache_size = 5632MB # pgtune wizard 2012-12-12 -work_mem = 36MB # pgtune wizard 2012-12-12 -wal_buffers = 4MB # pgtune wizard 2012-12-12 -checkpoint_segments = 8 # pgtune wizard 2012-12-12 -shared_buffers = 1792MB # pgtune wizard 2012-12-12 -max_connections = 200 # pgtune wizard 2012-12-12 +maintenance_work_mem = 1GB # pgtune wizard 2013-04-12 +checkpoint_completion_target = 0.7 # pgtune wizard 2013-04-12 +effective_cache_size = 22GB # pgtune wizard 2013-04-12 +work_mem = 160MB # pgtune wizard 2013-04-12 +wal_buffers = 4MB # pgtune wizard 2013-04-12 +checkpoint_segments = 8 # pgtune wizard 2013-04-12 +shared_buffers = 7680MB # pgtune wizard 2013-04-12 +max_connections = 200 # pgtune wizard 2013-04-12 timezone = 'UTC' -# EBS supposedly has very similar sequential and random access performance -random_page_cost = 1.1 +# From http://www.databasesoup.com/2012/05/random-page-cost-revisited.html +# This needs actual measurement, as bonnie++ random seek latency is +# actually a read/write test +random_page_cost = 2.0 + +effective_io_concurrency = 2 # As suggested by Postgres manual, set to number of disks in RAID listen_addresses = '*' log_destination = 'stderr' @@ -582,7 +586,7 @@ log_autovacuum_min_duration = 100 # Master replication settings (ignored on standby) wal_level = hot_standby -max_wal_senders = 2 +max_wal_senders = 5 archive_mode = on archive_command = 'cp -f %p /var/lib/postgresql/9.1/main/archive/%f